Bug 1539132 - Part 1: Don't root common-names which are implicitly rooted. r=arai
authorAndré Bargull <andre.bargull@gmail.com>
Wed, 03 Apr 2019 20:01:27 +0000
changeset 467954 f8e989e26332761a57a346eaf705d34731c962f6
parent 467953 304f28818b0f9a9c1dbc11a9c517248e03c6b8d4
child 467955 784e5f703238541bed18b9bce044db695db41fc7
push id112667
push useraiakab@mozilla.com
push dateThu, 04 Apr 2019 16:12:45 +0000
treeherdermozilla-inbound@230bb363f2f3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersarai
bugs1539132
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 1539132 - Part 1: Don't root common-names which are implicitly rooted. r=arai Differential Revision: https://phabricator.services.mozilla.com/D25568
js/src/vm/AsyncFunction.cpp
js/src/vm/AsyncIteration.cpp
js/src/vm/GeneratorObject.cpp
js/src/vm/JSFunction.cpp
--- a/js/src/vm/AsyncFunction.cpp
+++ b/js/src/vm/AsyncFunction.cpp
@@ -38,17 +38,17 @@ bool GlobalObject::initAsyncFunction(JSC
     return false;
   }
 
   RootedValue function(cx, global->getConstructor(JSProto_Function));
   if (!function.toObjectOrNull()) {
     return false;
   }
   RootedObject proto(cx, &function.toObject());
-  RootedAtom name(cx, cx->names().AsyncFunction);
+  HandlePropertyName name = cx->names().AsyncFunction;
   RootedObject asyncFunction(
       cx, NewFunctionWithProto(cx, AsyncFunctionConstructor, 1,
                                JSFunction::NATIVE_CTOR, nullptr, name, proto));
   if (!asyncFunction) {
     return false;
   }
   if (!LinkConstructorAndPrototype(cx, asyncFunction, asyncFunctionProto,
                                    JSPROP_PERMANENT | JSPROP_READONLY,
--- a/js/src/vm/AsyncIteration.cpp
+++ b/js/src/vm/AsyncIteration.cpp
@@ -460,17 +460,17 @@ static const JSFunctionSpec async_genera
     return false;
   }
 
   RootedValue function(cx, global->getConstructor(JSProto_Function));
   if (!function.toObjectOrNull()) {
     return false;
   }
   RootedObject proto(cx, &function.toObject());
-  RootedAtom name(cx, cx->names().AsyncGeneratorFunction);
+  HandlePropertyName name = cx->names().AsyncGeneratorFunction;
 
   // 25.3.1 The AsyncGeneratorFunction Constructor
   RootedObject asyncGenFunction(
       cx, NewFunctionWithProto(cx, AsyncGeneratorConstructor, 1,
                                JSFunction::NATIVE_CTOR, nullptr, name, proto,
                                gc::AllocKind::FUNCTION, SingletonObject));
   if (!asyncGenFunction) {
     return false;
--- a/js/src/vm/GeneratorObject.cpp
+++ b/js/src/vm/GeneratorObject.cpp
@@ -273,17 +273,17 @@ bool GlobalObject::initGenerators(JSCont
     return false;
   }
 
   RootedValue function(cx, global->getConstructor(JSProto_Function));
   if (!function.toObjectOrNull()) {
     return false;
   }
   RootedObject proto(cx, &function.toObject());
-  RootedAtom name(cx, cx->names().GeneratorFunction);
+  HandlePropertyName name = cx->names().GeneratorFunction;
   RootedObject genFunction(
       cx, NewFunctionWithProto(cx, Generator, 1, JSFunction::NATIVE_CTOR,
                                nullptr, name, proto, gc::AllocKind::FUNCTION,
                                SingletonObject));
   if (!genFunction) {
     return false;
   }
   if (!LinkConstructorAndPrototype(cx, genFunction, genFunctionProto,
--- a/js/src/vm/JSFunction.cpp
+++ b/js/src/vm/JSFunction.cpp
@@ -1892,17 +1892,17 @@ static bool CreateDynamicFunction(JSCont
   }
 
   /*
    * NB: (new Function) is not lexically closed by its caller, it's just an
    * anonymous function in the top-level scope that its constructor inhabits.
    * Thus 'var x = 42; f = new Function("return x"); print(f())' prints 42,
    * and so would a call to f from another top-level's script or function.
    */
-  RootedAtom anonymousAtom(cx, cx->names().anonymous);
+  HandlePropertyName anonymousAtom = cx->names().anonymous;
 
   // Initialize the function with the default prototype:
   // Leave as nullptr to get the default from clasp for normal functions.
   RootedObject defaultProto(cx);
   if (!GetFunctionPrototype(cx, generatorKind, asyncKind, &defaultProto)) {
     return false;
   }