Bug 936966 - Fix computation deciding whether to allocate in MNewArray. r=jandem, a=lsblakk
authorBrian Hackett <bhackett1024@gmail.com>
Sun, 17 Nov 2013 15:44:14 -0700
changeset 167797 77e29fc57c6b1173acd9c23f56ae31e4299e5cc3
parent 167796 842c26f878c55e717228c6b54b62da907257f9d4
child 167798 2765cb3f2d5e33997b3d7a88a77d7a89f8d65073
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem, lsblakk
bugs936966
milestone27.0
Bug 936966 - Fix computation deciding whether to allocate in MNewArray. r=jandem, a=lsblakk
js/src/jit/MIR.cpp
--- a/js/src/jit/MIR.cpp
+++ b/js/src/jit/MIR.cpp
@@ -2488,23 +2488,23 @@ MNewObject::shouldUseVM() const
            templateObject()->hasDynamicSlots();
 }
 
 bool
 MNewArray::shouldUseVM() const
 {
     JS_ASSERT(count() < JSObject::NELEMENTS_LIMIT);
 
-    size_t maxArraySlots =
-        gc::GetGCKindSlots(gc::FINALIZE_OBJECT_LAST) - ObjectElements::VALUES_PER_HEADER;
+    size_t arraySlots =
+        gc::GetGCKindSlots(templateObject()->tenuredGetAllocKind()) - ObjectElements::VALUES_PER_HEADER;
 
     // Allocate space using the VMCall
-    // when mir hints it needs to get allocated immediatly,
+    // when mir hints it needs to get allocated immediately,
     // but only when data doesn't fit the available array slots.
-    bool allocating = isAllocating() && count() > maxArraySlots;
+    bool allocating = isAllocating() && count() > arraySlots;
 
     return templateObject()->hasSingletonType() || allocating;
 }
 
 bool
 MLoadFixedSlot::mightAlias(MDefinition *store)
 {
     if (store->isStoreFixedSlot() && store->toStoreFixedSlot()->slot() != slot())