Bug 911333 - Remove customTrace from bindings codegen. r=bz

This commit is contained in:
Andrew McCreight 2013-09-10 08:29:44 -07:00
parent 797e84dcb3
commit ed2bc0d289
3 changed files with 4 additions and 23 deletions

View File

@ -26,8 +26,6 @@
# interfaces. Defaults to True otherwise.
# * workers - Indicates whether the descriptor is intended to be used for
# worker threads (defaults to false).
# * customTrace - The native class will use a custom trace hook (defaults to
# true for workers, false otherwise).
# * customFinalize - The native class will use a custom finalize hook
# (defaults to true for workers, false otherwise).
# * wantsQI - Indicates whether the interface should have a QueryInterface

View File

@ -18,7 +18,6 @@ AUTOGENERATED_WARNING_COMMENT = \
"/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */\n\n"
ADDPROPERTY_HOOK_NAME = '_addProperty'
FINALIZE_HOOK_NAME = '_finalize'
TRACE_HOOK_NAME = '_trace'
CONSTRUCT_HOOK_NAME = '_constructor'
LEGACYCALLER_HOOK_NAME = '_legacycaller'
HASINSTANCE_HOOK_NAME = '_hasInstance'
@ -176,7 +175,10 @@ class CGDOMJSClass(CGThing):
def declare(self):
return ""
def define(self):
traceHook = TRACE_HOOK_NAME if self.descriptor.customTrace else 'nullptr'
# Custom tracehooks are a footgun, so avoid supporting them. For instance,
# you have to be careful about barriers, and if you don't set a JSClass flag,
# then you'll end up permanently disabling incremental GC.
traceHook = 'nullptr'
callHook = LEGACYCALLER_HOOK_NAME if self.descriptor.operations["LegacyCaller"] else 'nullptr'
classFlags = "JSCLASS_IS_DOMJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(3)"
if self.descriptor.interface.getExtendedAttribute("NeedNewResolve"):
@ -1068,20 +1070,6 @@ class CGClassFinalizeHook(CGAbstractClassHook):
def generate_code(self):
return CGIndenter(finalizeHook(self.descriptor, self.name, self.args[0].name)).define()
class CGClassTraceHook(CGAbstractClassHook):
"""
A hook to trace through our native object; used for GC and CC
"""
def __init__(self, descriptor):
args = [Argument('JSTracer*', 'trc'), Argument('JSObject*', 'obj')]
CGAbstractClassHook.__init__(self, descriptor, TRACE_HOOK_NAME, 'void',
args)
def generate_code(self):
return """ if (self) {
self->%s(%s);
}""" % (self.name, self.args[0].name)
class CGClassConstructor(CGAbstractStaticMethod):
"""
JS-visible constructor for our objects
@ -7975,10 +7963,6 @@ class CGDescriptor(CGThing):
# wants a custom hook.
cgThings.append(CGClassFinalizeHook(descriptor))
# Only generate a trace hook if the class wants a custom hook.
if (descriptor.customTrace):
cgThings.append(CGClassTraceHook(descriptor))
properties = PropertyArrays(descriptor)
cgThings.append(CGGeneric(define=str(properties)))
cgThings.append(CGNativeProperties(descriptor, properties))

View File

@ -354,7 +354,6 @@ class Descriptor(DescriptorProvider):
raise TypeError("Descriptor for %s has unrecognized value (%s) "
"for nativeOwnership" %
(self.interface.identifier.name, self.nativeOwnership))
self.customTrace = desc.get('customTrace', self.workers)
self.customFinalize = desc.get('customFinalize', self.workers)
if desc.get('wantsQI', None) != None:
self._wantsQI = desc.get('wantsQI', None)