mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 936966 - Fix computation deciding whether to allocate in MNewArray, r=jandem.
This commit is contained in:
parent
0ef197fc0a
commit
55412888c2
@ -2509,13 +2509,13 @@ MNewArray::shouldUseVM() const
|
|||||||
{
|
{
|
||||||
JS_ASSERT(count() < JSObject::NELEMENTS_LIMIT);
|
JS_ASSERT(count() < JSObject::NELEMENTS_LIMIT);
|
||||||
|
|
||||||
size_t maxArraySlots =
|
size_t arraySlots =
|
||||||
gc::GetGCKindSlots(gc::FINALIZE_OBJECT_LAST) - ObjectElements::VALUES_PER_HEADER;
|
gc::GetGCKindSlots(templateObject()->tenuredGetAllocKind()) - ObjectElements::VALUES_PER_HEADER;
|
||||||
|
|
||||||
// Allocate space using the VMCall
|
// 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.
|
// 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;
|
return templateObject()->hasSingletonType() || allocating;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user