Backed out changeset 83e8b0ff394c (Bug 1081268) for Octane Mandreel regression.
authorNicolas B. Pierron <nicolas.b.pierron@mozilla.com>
Fri, 24 Oct 2014 14:34:41 +0200
changeset 212231 07e476ab730bc8dbf19ddeed751fc447314ac8ee
parent 212230 c275c8e2fe0a8cbf0f7f30869ec6dc0eecb0b2fc
child 212232 5a26c66bc295bdf6a18a852f855a67b460a762f8
push id27702
push userkwierso@gmail.com
push dateFri, 24 Oct 2014 22:05:50 +0000
treeherdermozilla-central@c70f62375f7d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1081268
milestone36.0a1
backs out83e8b0ff394c98602b02de2fa5f7c377af63e81c
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 83e8b0ff394c (Bug 1081268) for Octane Mandreel regression.
js/src/vm/TypedArrayObject.cpp
--- a/js/src/vm/TypedArrayObject.cpp
+++ b/js/src/vm/TypedArrayObject.cpp
@@ -303,23 +303,28 @@ class TypedArrayObjectTemplate : public 
 
         return &obj->as<TypedArrayObject>();
     }
 
     static TypedArrayObject *
     makeTypedInstance(JSContext *cx, uint32_t len, gc::AllocKind allocKind)
     {
         const Class *clasp = instanceClass();
-        bool largeAllocation = len * sizeof(NativeType) >= TypedArrayObject::SINGLETON_TYPE_BYTE_LENGTH;
+        if (len * sizeof(NativeType) >= TypedArrayObject::SINGLETON_TYPE_BYTE_LENGTH) {
+            JSObject *obj = NewBuiltinClassInstance(cx, clasp, allocKind, SingletonObject);
+            if (!obj)
+                return nullptr;
+            return &obj->as<TypedArrayObject>();
+        }
 
         jsbytecode *pc;
         RootedScript script(cx, cx->currentScript(&pc));
         NewObjectKind newKind = script
                                 ? UseNewTypeForInitializer(script, pc, clasp)
-                                : (largeAllocation ? SingletonObject : GenericObject);
+                                : GenericObject;
         RootedObject obj(cx, NewBuiltinClassInstance(cx, clasp, allocKind, newKind));
         if (!obj)
             return nullptr;
 
         if (script) {
             if (!types::SetInitializerObjectType(cx, script, pc, obj, newKind))
                 return nullptr;
         }