Bug 1534593 part 1. Stop special-casing JS::Value initialization, since JS::Value now always initializes itself on construction. r=jwalden,qdot
authorBoris Zbarsky <bzbarsky@mit.edu>
Tue, 16 Apr 2019 19:11:40 +0000
changeset 469840 606bba3b09248942c5cdbfb44e119d40f9dd054c
parent 469839 753a06be639a7a0c1d61458a76b4ff7662bed3de
child 469841 988efe7f290a677c37ecdd9cf5450632d91e7759
push id35883
push userbtara@mozilla.com
push dateWed, 17 Apr 2019 21:47:29 +0000
treeherdermozilla-central@02b89c29412b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwalden, qdot
bugs1534593
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1534593 part 1. Stop special-casing JS::Value initialization, since JS::Value now always initializes itself on construction. r=jwalden,qdot Differential Revision: https://phabricator.services.mozilla.com/D27560
dom/bindings/Codegen.py
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -14035,18 +14035,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()
@@ -16680,17 +16678,17 @@ class ConstructCallback(CallbackMember):
     def __init__(self, callback, descriptorProvider):
         self.callback = callback
         CallbackMember.__init__(self, callback.signatures()[0], "Construct",
                                 descriptorProvider, needThisHandling=False,
                                 canRunScript=True)
 
     def getRvalDecl(self):
         # Box constructedObj for getJSToNativeConversionInfo().
-        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(
@@ -16721,17 +16719,17 @@ class CallbackMethod(CallbackMember):
                  spiderMonkeyInterfacesAreStructs=False,
                  canRunScript=False):
         CallbackMember.__init__(self, sig, name, descriptorProvider,
                                 needThisHandling, rethrowContentException,
                                 spiderMonkeyInterfacesAreStructs=spiderMonkeyInterfacesAreStructs,
                                 canRunScript=canRunScript)
 
     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(
@@ -16878,17 +16876,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)) {