From 55412888c2364a4d62e526f20b759ff549de07aa Mon Sep 17 00:00:00 2001 From: Brian Hackett Date: Sun, 17 Nov 2013 15:44:14 -0700 Subject: [PATCH] Bug 936966 - Fix computation deciding whether to allocate in MNewArray, r=jandem. --- js/src/jit/MIR.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/src/jit/MIR.cpp b/js/src/jit/MIR.cpp index 1df0292b9ce..ac8cc3c041d 100644 --- a/js/src/jit/MIR.cpp +++ b/js/src/jit/MIR.cpp @@ -2509,13 +2509,13 @@ 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; }