diff --git a/dom/bindings/Bindings.conf b/dom/bindings/Bindings.conf index a9729696cebb..95df5dbacbcd 100644 --- a/dom/bindings/Bindings.conf +++ b/dom/bindings/Bindings.conf @@ -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 diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py index e013387572bf..ff302f122e1b 100644 --- a/dom/bindings/Codegen.py +++ b/dom/bindings/Codegen.py @@ -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)) diff --git a/dom/bindings/Configuration.py b/dom/bindings/Configuration.py index 62767b186396..89eaea52a4a7 100644 --- a/dom/bindings/Configuration.py +++ b/dom/bindings/Configuration.py @@ -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)