Bug 1320408 - Part 7: Remove JSContext* parameter from JSObject::shouldSplicePrototype. r=jandem
authorTooru Fujisawa <arai_a@mac.com>
Sat, 31 Dec 2016 16:03:02 +0900
changeset 327743 2caf84698f926b00b3f092694b76924e656ee867
parent 327742 d56269f92df741484eb92e08564185ae0df55c08
child 327744 13b297c37408524ae3891d550bfd28e03bfa3c76
push id35556
push userphilringnalda@gmail.com
push dateSat, 31 Dec 2016 19:31:58 +0000
treeherderautoland@cb9f43eb5525 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1320408
milestone53.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 1320408 - Part 7: Remove JSContext* parameter from JSObject::shouldSplicePrototype. r=jandem
js/src/builtin/Object.cpp
js/src/jsobj.h
js/src/vm/ObjectGroup.cpp
--- a/js/src/builtin/Object.cpp
+++ b/js/src/builtin/Object.cpp
@@ -1309,17 +1309,17 @@ FinishObjectClassInit(JSContext* cx, JS:
      * The global object should have |Object.prototype| as its [[Prototype]].
      * Eventually we'd like to have standard classes be there from the start,
      * and thus we would know we were always setting what had previously been a
      * null [[Prototype]], but right now some code assumes it can set the
      * [[Prototype]] before standard classes have been initialized.  For now,
      * only set the [[Prototype]] if it hasn't already been set.
      */
     Rooted<TaggedProto> tagged(cx, TaggedProto(proto));
-    if (global->shouldSplicePrototype(cx)) {
+    if (global->shouldSplicePrototype()) {
         if (!JSObject::splicePrototype(cx, global, global->getClass(), tagged))
             return false;
     }
     return true;
 }
 
 static const ClassSpec PlainObjectClassSpec = {
     CreateObjectConstructor,
--- a/js/src/jsobj.h
+++ b/js/src/jsobj.h
@@ -439,17 +439,17 @@ class JSObject : public js::gc::Cell
     /* Set a new prototype for an object with a singleton type. */
     static bool splicePrototype(JSContext* cx, js::HandleObject obj, const js::Class* clasp,
                                 js::Handle<js::TaggedProto> proto);
 
     /*
      * For bootstrapping, whether to splice a prototype for Function.prototype
      * or the global object.
      */
-    bool shouldSplicePrototype(JSContext* cx);
+    bool shouldSplicePrototype();
 
     /*
      * Environment chains.
      *
      * The environment chain of an object is the link in the search path when
      * a script does a name lookup on an environment object. For JS internal
      * environment objects --- Call, LexicalEnvironment, and WithEnvironment
      * --- the chain is stored in the first fixed slot of the object.  For
--- a/js/src/vm/ObjectGroup.cpp
+++ b/js/src/vm/ObjectGroup.cpp
@@ -247,17 +247,17 @@ ObjectGroup::useSingletonForAllocationSi
     return useSingletonForAllocationSite(script, pc, JSCLASS_CACHED_PROTO_KEY(clasp));
 }
 
 /////////////////////////////////////////////////////////////////////
 // JSObject
 /////////////////////////////////////////////////////////////////////
 
 bool
-JSObject::shouldSplicePrototype(JSContext* cx)
+JSObject::shouldSplicePrototype()
 {
     /*
      * During bootstrapping, if inference is enabled we need to make sure not
      * to splice a new prototype in for Function.prototype or the global
      * object if their __proto__ had previously been set to null, as this
      * will change the prototype for all other objects with the same type.
      */
     if (staticPrototype() != nullptr)