Bug 1534593 part 1. Stop special-casing JS::Value initialization, since JS::Value now always initializes itself on construction. r=qdot,waldo a=abillings
authorBoris Zbarsky <bzbarsky@mit.edu>
Mon, 15 Apr 2019 15:26:49 -0400
changeset 526228 ef03afcf3cffaabbfd5a8e951315dbcbbd45a004
parent 526227 ca3353d353beef5ba2bdaf31619fe4650ec0c531
child 526229 499c3102dc05f7654036438d2da12fc0565e6ff5
push id2032
push userffxbld-merge
push dateMon, 13 May 2019 09:36:57 +0000
treeherdermozilla-release@455c1065dcbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersqdot, waldo, abillings
bugs1534593
milestone67.0
Bug 1534593 part 1. Stop special-casing JS::Value initialization, since JS::Value now always initializes itself on construction. r=qdot,waldo a=abillings
dom/bindings/Codegen.py
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -14011,18 +14011,16 @@ class CGDictionary(CGThing):
         """
         member, _ = memberInfo
         if member.canHaveMissingValue():
             # Allowed missing value means no need to set it up front, since it's
             # inside an Optional and won't get traced until it's actually set
             # up.
             return None
         type = member.type
-        if type.isAny():
-            return "JS::UndefinedValue()"
         if type.isObject():
             return "nullptr"
         if type.isDictionary():
             # When we construct ourselves, we don't want to init our member
             # dictionaries.  Either we're being constructed-but-not-initialized
             # ourselves (and then we don't want to init them) or we're about to
             # init ourselves and then we'll init them anyway.
             return CGDictionary.getNonInitializingCtorArg()
@@ -16645,17 +16643,17 @@ class CallbackMethod(CallbackMember):
     def __init__(self, sig, name, descriptorProvider, needThisHandling,
                  rethrowContentException=False,
                  spiderMonkeyInterfacesAreStructs=False):
         CallbackMember.__init__(self, sig, name, descriptorProvider,
                                 needThisHandling, rethrowContentException,
                                 spiderMonkeyInterfacesAreStructs=spiderMonkeyInterfacesAreStructs)
 
     def getRvalDecl(self):
-        return "JS::Rooted<JS::Value> rval(cx, JS::UndefinedValue());\n"
+        return "JS::Rooted<JS::Value> rval(cx);\n"
 
     def getCall(self):
         if self.argCount > 0:
             args = "JS::HandleValueArray::subarray(argv, 0, argc)"
         else:
             args = "JS::HandleValueArray::empty()"
 
         return fill(
@@ -16801,17 +16799,17 @@ class CallbackGetter(CallbackAccessor):
     def __init__(self, attr, descriptor, spiderMonkeyInterfacesAreStructs):
         CallbackAccessor.__init__(self, attr,
                                   (attr.type, []),
                                   callbackGetterName(attr, descriptor),
                                   descriptor,
                                   spiderMonkeyInterfacesAreStructs)
 
     def getRvalDecl(self):
-        return "JS::Rooted<JS::Value> rval(cx, JS::UndefinedValue());\n"
+        return "JS::Rooted<JS::Value> rval(cx);\n"
 
     def getCall(self):
         return fill(
             """
             JS::Rooted<JSObject *> callback(cx, mCallback);
             ${atomCacheName}* atomsCache = GetAtomCache<${atomCacheName}>(cx);
             if ((!*reinterpret_cast<jsid**>(atomsCache) && !InitIds(cx, atomsCache)) ||
                 !JS_GetPropertyById(cx, callback, atomsCache->${attrAtomName}, &rval)) {