--- a/js/xpconnect/src/qsgen.py
+++ b/js/xpconnect/src/qsgen.py
@@ -1093,20 +1093,17 @@ def writeSpecs(f, elementType, varname,
f.write("};\n\n")
def writeDefiner(f, conf, stringtable, interfaces):
f.write("// === Definer\n\n")
# Write out the properties and functions
propspecs_indices = {}
funcspecs_indices = {}
- prop_array_name = "all_properties"
func_array_name = "all_functions"
- writeSpecs(f, "xpc_qsPropertySpec", prop_array_name,
- "propspecs", propspecs_indices, interfaces)
writeSpecs(f, "xpc_qsFunctionSpec", func_array_name,
"funcspecs", funcspecs_indices, interfaces)
# generate the static hash table
loadFactor = 0.6
size = int(len(interfaces) / loadFactor)
buckets = [[] for i in range(size)]
for iface in interfaces:
@@ -1142,16 +1139,17 @@ def writeDefiner(f, conf, stringtable, i
% (m3[0:2], m3[2:4], m4[0:2], m4[2:4],
m4[4:6], m4[6:8], m4[8:10], m4[10:12]))
iid = ('{0x%s, 0x%s, 0x%s, %s}' % (m0, m1, m2, m3arr))
# properties fields
prop_index = 0
prop_n_entries = 0
if iface.propspecs:
+ assert False
prop_index = propspecs_indices[iface.name]
prop_n_entries = len(iface.propspecs)
# member fields
func_index = 0
func_n_entries = 0
if iface.funcspecs:
func_index = funcspecs_indices[iface.name]
@@ -1188,31 +1186,31 @@ def writeDefiner(f, conf, stringtable, i
f.write("\n };\n\n")
f.write("// Make sure our table indices aren't overflowed\n"
"PR_STATIC_ASSERT((sizeof(tableData) / sizeof(tableData[0])) < (1 << (8 * sizeof(tableData[0].parentInterface))));\n"
"PR_STATIC_ASSERT((sizeof(tableData) / sizeof(tableData[0])) < (1 << (8 * sizeof(tableData[0].chain))));\n\n")
# The string table for property and method names.
table_name = "stringtab"
stringtable.writeDefinition(f, table_name)
- structNames = [prop_array_name, func_array_name]
+ structNames = [func_array_name]
for name in structNames:
f.write("PR_STATIC_ASSERT(sizeof(%s) < (1 << (8 * sizeof(%s[0].name_index))));\n"
% (table_name, name))
f.write("\n")
# the definer function (entry point to this quick stubs file)
f.write("namespace xpc {\n")
f.write("bool %s_DefineQuickStubs(" % conf.name)
f.write("JSContext *cx, JSObject *proto, unsigned flags, uint32_t count, "
"const nsID **iids)\n"
"{\n")
f.write(" return !!xpc_qsDefineQuickStubs("
"cx, proto, flags, count, iids, %d, tableData, %s, %s, %s);\n" % (
- size, prop_array_name, func_array_name, table_name))
+ size, "nullptr", func_array_name, table_name))
f.write("}\n")
f.write("} // namespace xpc\n\n\n")
stubTopTemplate = '''\
/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */
#include "jsapi.h"
#include "qsWinUndefs.h"