Bug 1443830 - Backed out changeset 1236752bf224 (bug 785440) for installer size regression. r=mstange, a=RyanVM
authorJulien Cristau <jcristau@mozilla.com>
Mon, 12 Mar 2018 16:19:38 +0100
changeset 473216 62070576cd82f2d6bd15b4cdbbe4ce6c04a713bd
parent 473215 be193b32a5b61e71420607748097faadd0e71bc4
child 473217 eb9cb027960f77a12fe25c6b807d37ea5bf14579
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange, RyanVM
bugs1443830, 785440
milestone61.0
Bug 1443830 - Backed out changeset 1236752bf224 (bug 785440) for installer size regression. r=mstange, a=RyanVM
dom/bindings/Codegen.py
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -1571,22 +1571,16 @@ class CGAbstractMethod(CGThing):
         elif self.inline:
             decorators.append('inline')
         if self.static:
             decorators.append('static')
         decorators.append(self.returnType)
         maybeNewline = " " if self.inline else "\n"
         return ' '.join(decorators) + maybeNewline
 
-    def _auto_profiler_label(self):
-        profiler_label_and_jscontext = self.profiler_label_and_jscontext()
-        if profiler_label_and_jscontext:
-            return 'AUTO_PROFILER_LABEL_FAST("%s", OTHER, %s);' % profiler_label_and_jscontext
-        return None
-
     def declare(self):
         if self.inline:
             return self._define(True)
         return "%s%s%s(%s);\n" % (self._template(), self._decorators(), self.name, self._argstring(True))
 
     def indent_body(self, body):
         """
         Indent the code returned by self.definition_body(). Most classes
@@ -1599,36 +1593,25 @@ class CGAbstractMethod(CGThing):
         return (self.definition_prologue(fromDeclare) +
                 self.indent_body(self.definition_body()) +
                 self.definition_epilogue())
 
     def define(self):
         return "" if self.inline else self._define()
 
     def definition_prologue(self, fromDeclare):
-        prologue = "%s%s%s(%s)\n{\n" % (self._template(), self._decorators(),
-                                        self.name, self._argstring(fromDeclare))
-        profiler_label = self._auto_profiler_label()
-        if profiler_label:
-            prologue += "  %s\n\n" % profiler_label
-
-        return prologue
+        return "%s%s%s(%s)\n{\n" % (self._template(), self._decorators(),
+                                    self.name, self._argstring(fromDeclare))
 
     def definition_epilogue(self):
         return "}\n"
 
     def definition_body(self):
         assert False  # Override me!
 
-    """
-    Override this method to return a pair of (descriptive string, name of a
-    JSContext* variable) in order to generate a profiler label for this method.
-    """
-    def profiler_label_and_jscontext(self):
-        return None # Override me!
 
 class CGAbstractStaticMethod(CGAbstractMethod):
     """
     Abstract base class for codegen of implementation-only (no
     declaration) static methods.
     """
     def __init__(self, descriptor, name, returnType, args, canRunScript=False):
         CGAbstractMethod.__init__(self, descriptor, name, returnType, args,
@@ -1856,23 +1839,16 @@ class CGClassConstructor(CGAbstractStati
 
         name = self._ctor.identifier.name
         nativeName = MakeNativeName(self.descriptor.binaryNameFor(name))
         callGenerator = CGMethodCall(nativeName, True, self.descriptor,
                                      self._ctor, isConstructor=True,
                                      constructorName=ctorName)
         return preamble + "\n" + callGenerator.define()
 
-    def profiler_label_and_jscontext(self):
-        name = self._ctor.identifier.name
-        if name != "constructor":
-            ctorName = name
-        else:
-            ctorName = self.descriptor.interface.identifier.name
-        return ("%s constructor" % ctorName, "cx")
 
 # Encapsulate the constructor in a helper method to share genConstructorBody with CGJSImplMethod.
 class CGConstructNavigatorObject(CGAbstractMethod):
     """
     Construct a new JS-implemented WebIDL DOM object, for use on navigator.
     """
     def __init__(self, descriptor):
         args = [Argument('JSContext*', 'cx'),
@@ -8533,27 +8509,19 @@ class CGAbstractStaticBindingMethod(CGAb
         # later use it to wrap return values.
         unwrap = dedent("""
             JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
             JS::Rooted<JSObject*> obj(cx, &args.callee());
 
             """)
         return unwrap + self.generate_code().define()
 
-    def profiler_label_and_jscontext(self):
-        # Our args are JSNativeArguments() which contain a "JSContext* cx"
-        # argument. We let our subclasses choose the label.
-        return (self.profiler_label(), "cx")
-
     def generate_code(self):
         assert False  # Override me
 
-    def profiler_label(self):
-        assert False # Override me
-
 
 def MakeNativeName(name):
     return name[0].upper() + IDLToCIdentifier(name[1:])
 
 
 class CGSpecializedMethod(CGAbstractStaticMethod):
     """
     A class for generating the C++ code for a specialized method that the JIT
@@ -8570,21 +8538,16 @@ class CGSpecializedMethod(CGAbstractStat
                                         canRunScript=True)
 
     def definition_body(self):
         nativeName = CGSpecializedMethod.makeNativeName(self.descriptor,
                                                         self.method)
         return CGMethodCall(nativeName, self.method.isStatic(), self.descriptor,
                             self.method).define()
 
-    def profiler_label_and_jscontext(self):
-        interface_name = self.descriptor.interface.identifier.name
-        method_name = self.method.identifier.name
-        return ("%s.%s" % (interface_name, method_name), "cx")
-
     @staticmethod
     def makeNativeName(descriptor, method):
         name = method.identifier.name
         return MakeNativeName(descriptor.binaryNameFor(name))
 
 
 class CGMethodPromiseWrapper(CGAbstractStaticMethod):
     """
@@ -8830,21 +8793,16 @@ class CGStaticMethod(CGAbstractStaticBin
         name = CppKeywords.checkMethodName(IDLToCIdentifier(method.identifier.name))
         CGAbstractStaticBindingMethod.__init__(self, descriptor, name)
 
     def generate_code(self):
         nativeName = CGSpecializedMethod.makeNativeName(self.descriptor,
                                                         self.method)
         return CGMethodCall(nativeName, True, self.descriptor, self.method)
 
-    def profiler_label(self):
-        interface_name = self.descriptor.interface.identifier.name
-        method_name = self.method.identifier.name
-        return "%s.%s" % (interface_name, method_name)
-
 
 class CGSpecializedGetter(CGAbstractStaticMethod):
     """
     A class for generating the code for a specialized attribute getter
     that the JIT can call with lower overhead.
     """
     def __init__(self, descriptor, attr):
         self.attr = attr
@@ -8937,21 +8895,16 @@ class CGSpecializedGetter(CGAbstractStat
         if self.attr.navigatorObjectGetter:
             cgGetterCall = CGNavigatorGetterCall
         else:
             cgGetterCall = CGGetterCall
         return (prefix +
                 cgGetterCall(self.attr.type, nativeName,
                              self.descriptor, self.attr).define())
 
-    def profiler_label_and_jscontext(self):
-        interface_name = self.descriptor.interface.identifier.name
-        attr_name = self.attr.identifier.name
-        return ("get %s.%s" % (interface_name, attr_name), "cx")
-
     @staticmethod
     def makeNativeName(descriptor, attr):
         name = attr.identifier.name
         nativeName = MakeNativeName(descriptor.binaryNameFor(name))
         _, resultOutParam, _, _, _ = getRetvalDeclarationForType(attr.type,
                                                                  descriptor)
         extendedAttrs = descriptor.getExtendedAttributes(attr, getter=True)
         canFail = ('infallible' not in extendedAttrs or
@@ -9000,21 +8953,16 @@ class CGStaticGetter(CGAbstractStaticBin
         CGAbstractStaticBindingMethod.__init__(self, descriptor, name)
 
     def generate_code(self):
         nativeName = CGSpecializedGetter.makeNativeName(self.descriptor,
                                                         self.attr)
         return CGGetterCall(self.attr.type, nativeName, self.descriptor,
                             self.attr)
 
-    def profiler_label(self):
-        interface_name = self.descriptor.interface.identifier.name
-        attr_name = self.attr.identifier.name
-        return "get %s.%s" % (interface_name, attr_name)
-
 
 class CGSpecializedSetter(CGAbstractStaticMethod):
     """
     A class for generating the code for a specialized attribute setter
     that the JIT can call with lower overhead.
     """
     def __init__(self, descriptor, attr):
         self.attr = attr
@@ -9027,21 +8975,16 @@ class CGSpecializedSetter(CGAbstractStat
                                         canRunScript=True)
 
     def definition_body(self):
         nativeName = CGSpecializedSetter.makeNativeName(self.descriptor,
                                                         self.attr)
         return CGSetterCall(self.attr.type, nativeName, self.descriptor,
                             self.attr).define()
 
-    def profiler_label_and_jscontext(self):
-        interface_name = self.descriptor.interface.identifier.name
-        attr_name = self.attr.identifier.name
-        return ("set %s.%s" % (interface_name, attr_name), "cx")
-
     @staticmethod
     def makeNativeName(descriptor, attr):
         name = attr.identifier.name
         return "Set" + MakeNativeName(descriptor.binaryNameFor(name))
 
 
 class CGStaticSetter(CGAbstractStaticBindingMethod):
     """
@@ -9061,21 +9004,16 @@ class CGStaticSetter(CGAbstractStaticBin
               return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "${name} setter");
             }
             """,
             name=self.attr.identifier.name))
         call = CGSetterCall(self.attr.type, nativeName, self.descriptor,
                             self.attr)
         return CGList([checkForArg, call])
 
-    def profiler_label(self):
-        interface_name = self.descriptor.interface.identifier.name
-        attr_name = self.attr.identifier.name
-        return "set %s.%s" % (interface_name, attr_name)
-
 
 class CGSpecializedForwardingSetter(CGSpecializedSetter):
     """
     A class for generating the code for a specialized attribute setter with
     PutForwards that the JIT can call with lower overhead.
     """
     def __init__(self, descriptor, attr):
         CGSpecializedSetter.__init__(self, descriptor, attr)
@@ -13827,17 +13765,16 @@ class CGBindingRoot(CGThing):
         bindingHeaders = dict.fromkeys((
             'mozilla/dom/NonRefcountedDOMObject.h',
             ),
             True)
         bindingDeclareHeaders = dict.fromkeys((
             'mozilla/dom/BindingDeclarations.h',
             'mozilla/dom/Nullable.h',
             'mozilla/ErrorResult.h',
-            'GeckoProfiler.h'
             ),
             True)
 
         descriptors = config.getDescriptors(webIDLFile=webIDLFile,
                                             hasInterfaceOrInterfacePrototypeObject=True)
 
         unionTypes = UnionsForFile(config, webIDLFile)