Backed out changeset d31171af48e4 (bug 1268034)
authorTooru Fujisawa <arai_a@mac.com>
Thu, 19 May 2016 20:47:07 +0900
changeset 298109 7861d6b6c274db85036adc5496718d456e3a78c8
parent 298108 84f23a8f3f2a91331fd49e6f6cc4aa0c3be66d1b
child 298110 9c2a58d84d498bd8841f3bd88e6091ebcba58818
push id30270
push userryanvm@gmail.com
push dateThu, 19 May 2016 16:47:16 +0000
treeherdermozilla-central@1806d405c871 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1268034
milestone49.0a1
backs outd31171af48e4fe4e0e35e6e96b4c76504a7ee091
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
Backed out changeset d31171af48e4 (bug 1268034)
js/src/jit-test/tests/auto-regress/bug1268034.js
js/src/vm/GlobalObject.cpp
js/src/vm/GlobalObject.h
deleted file mode 100644
--- a/js/src/jit-test/tests/auto-regress/bug1268034.js
+++ /dev/null
@@ -1,7 +0,0 @@
-if (!('oomTest' in this))
-    quit();
-
-oomTest(function() {
-    offThreadCompileScript("");
-});
-"".match();
--- a/js/src/vm/GlobalObject.cpp
+++ b/js/src/vm/GlobalObject.cpp
@@ -216,42 +216,19 @@ GlobalObject::resolveConstructor(JSConte
         return false;
 
     RootedId id(cx, NameToId(ClassName(key, cx)));
     if (clasp->specShouldDefineConstructor()) {
         if (!global->addDataProperty(cx, id, constructorPropertySlot(key), 0))
             return false;
     }
 
-    // Set the constructor slot here to make it usable from JS_DefineFunctions,
-    // especially with JSProto_Function, as Function.prototype.toString is also
-    // a function.
-    // All failure cases from here should reset them to undefined, to avoid
-    // leaving partially initiallized object in the constructor slot.
     global->setConstructor(key, ObjectValue(*ctor));
     global->setConstructorPropertySlot(key, ObjectValue(*ctor));
 
-    if (!defineConstructorPropertiesAndLinkPrototype(cx, global, key, clasp, id,
-                                                     ctor, proto))
-    {
-        global->setConstructor(key, UndefinedValue());
-        global->setConstructorPropertySlot(key, UndefinedValue());
-        return false;
-    }
-
-    return true;
-}
-
-/* static */ bool
-GlobalObject::defineConstructorPropertiesAndLinkPrototype(JSContext* cx,
-                                                          Handle<GlobalObject*> global,
-                                                          JSProtoKey key, const Class* clasp,
-                                                          HandleId id, HandleObject ctor,
-                                                          HandleObject proto)
-{
     // Define any specified functions and properties, unless we're a dependent
     // standard class (in which case they live on the prototype), or we're
     // operating on the self-hosting global, in which case we don't want any
     // functions and properties on the builtins and their prototypes.
     if (!StandardClassIsDependent(key) && !cx->runtime()->isSelfHostingGlobal(global)) {
         if (const JSFunctionSpec* funs = clasp->specPrototypeFunctions()) {
             if (!JS_DefineFunctions(cx, proto, funs))
                 return false;
--- a/js/src/vm/GlobalObject.h
+++ b/js/src/vm/GlobalObject.h
@@ -236,22 +236,16 @@ class GlobalObject : public NativeObject
      * manner.
      */
     static HandleObject upcast(Handle<GlobalObject*> global) {
         return HandleObject::fromMarkedLocation(
                 reinterpret_cast<JSObject * const*>(global.address()));
     }
 
   private:
-    static bool defineConstructorPropertiesAndLinkPrototype(JSContext* cx,
-                                                            Handle<GlobalObject*> global,
-                                                            JSProtoKey key, const Class* clasp,
-                                                            HandleId id, HandleObject ctor,
-                                                            HandleObject proto);
-
     bool arrayClassInitialized() const {
         return classIsInitialized(JSProto_Array);
     }
 
     bool booleanClassInitialized() const {
         return classIsInitialized(JSProto_Boolean);
     }
     bool numberClassInitialized() const {