Bug 959334 - Invoking js_InitTypedObjectModuleObject or js_InitSIMDClass in GlobalObject::initStandardClasses causes mochitest-plain to fail. r=Waldo
authorNiko Matsakis <niko@alum.mit.edu>
Fri, 31 Jan 2014 14:51:41 -0800
changeset 182481 a44f13894eb06d3b044e486dfb225a0747613fec
parent 182480 8f2ed497521925dcd5ef7add64cc27ad2f7a2fba
child 182482 b4c5406634861bc2db3d5de1d25ea95e6b405f12
push id3343
push userffxbld
push dateMon, 17 Mar 2014 21:55:32 +0000
treeherdermozilla-beta@2f7d3415f79f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersWaldo
bugs959334
milestone29.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 959334 - Invoking js_InitTypedObjectModuleObject or js_InitSIMDClass in GlobalObject::initStandardClasses causes mochitest-plain to fail. r=Waldo
js/src/builtin/TypeRepresentation.cpp
js/src/vm/GlobalObject.cpp
--- a/js/src/builtin/TypeRepresentation.cpp
+++ b/js/src/builtin/TypeRepresentation.cpp
@@ -381,24 +381,27 @@ TypeRepresentation::addToTableOrFree(JSC
 
     // Next, attempt to add the type representation to the table.
     if (!comp->typeReprs.relookupOrAdd(p, this, this)) {
         js_ReportOutOfMemory(cx);
         js_free(this); // do not finalize, not present in the table
         return nullptr;
     }
 
+    RootedObject objectProto(cx, global->getOrCreateObjectPrototype(cx));
+    if (!objectProto)
+        return nullptr;
+
     // Now that the object is in the table, try to make the owner
     // object. If this succeeds, then the owner will remove from the
     // table once it is finalized. Otherwise, if this fails, we must
     // remove ourselves from the table ourselves and report an error.
-    RootedObject ownerObject(cx,
-        NewBuiltinClassInstance(cx,
-                                &class_,
-                                gc::GetGCObjectKind(&class_)));
+    RootedObject ownerObject(cx);
+    ownerObject = NewObjectWithGivenProto(cx, &class_, objectProto,
+                                          cx->global());
     if (!ownerObject) {
         comp->typeReprs.remove(this);
         js_free(this);
         return nullptr;
     }
 
     ownerObject->setPrivate(this);
 
--- a/js/src/vm/GlobalObject.cpp
+++ b/js/src/vm/GlobalObject.cpp
@@ -506,16 +506,19 @@ GlobalObject::initStandardClasses(JSCont
            js_InitProxyClass(cx, global) &&
            js_InitMapClass(cx, global) &&
            GlobalObject::initMapIteratorProto(cx, global) &&
            js_InitSetClass(cx, global) &&
            GlobalObject::initSetIteratorProto(cx, global) &&
 #if EXPOSE_INTL_API
            js_InitIntlClass(cx, global) &&
 #endif
+#ifdef ENABLE_BINARYDATA
+           js_InitTypedObjectModuleObject(cx, global) &&
+#endif
            true;
 }
 
 /* static */ bool
 GlobalObject::isRuntimeCodeGenEnabled(JSContext *cx, Handle<GlobalObject*> global)
 {
     HeapSlot &v = global->getSlotRef(RUNTIME_CODEGEN_ENABLED);
     if (v.isUndefined()) {