Index: src/ia32/stub-cache-ia32.cc |
diff --git a/src/ia32/stub-cache-ia32.cc b/src/ia32/stub-cache-ia32.cc |
index e148e2f525c34959d492ba838e5666b392da9f33..71740ac5c7ebd1ea50bcaaa73ad7e9222e6d7931 100644 |
--- a/src/ia32/stub-cache-ia32.cc |
+++ b/src/ia32/stub-cache-ia32.cc |
@@ -1462,16 +1462,31 @@ Handle<Code> CallStubCompiler::CompileArrayPushCall( |
__ jmp(&fast_object); |
// In case of fast smi-only, convert to fast object, otherwise bail out. |
__ bind(¬_fast_object); |
- __ CheckFastSmiOnlyElements(ebx, &call_builtin); |
+ __ CheckFastSmiElements(ebx, &call_builtin); |
// edi: elements array |
// edx: receiver |
// ebx: map |
- __ LoadTransitionedArrayMapConditional(FAST_SMI_ONLY_ELEMENTS, |
+ Label try_holey_map; |
+ __ LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS, |
FAST_ELEMENTS, |
ebx, |
edi, |
+ &try_holey_map); |
+ |
+ ElementsTransitionGenerator:: |
+ GenerateMapChangeElementsTransition(masm()); |
+ // Restore edi. |
+ __ mov(edi, FieldOperand(edx, JSArray::kElementsOffset)); |
+ __ jmp(&fast_object); |
+ |
+ __ bind(&try_holey_map); |
+ __ LoadTransitionedArrayMapConditional(FAST_HOLEY_SMI_ELEMENTS, |
+ FAST_HOLEY_ELEMENTS, |
+ ebx, |
+ edi, |
&call_builtin); |
- ElementsTransitionGenerator::GenerateSmiOnlyToObject(masm()); |
+ ElementsTransitionGenerator:: |
+ GenerateMapChangeElementsTransition(masm()); |
// Restore edi. |
__ mov(edi, FieldOperand(edx, JSArray::kElementsOffset)); |
__ bind(&fast_object); |
@@ -3818,7 +3833,7 @@ void KeyedStoreStubCompiler::GenerateStoreFastElement( |
// Check that the key is a smi or a heap number convertible to a smi. |
GenerateSmiKeyCheck(masm, ecx, ebx, xmm0, xmm1, &miss_force_generic); |
- if (elements_kind == FAST_SMI_ONLY_ELEMENTS) { |
+ if (IsFastSmiElementsKind(elements_kind)) { |
__ JumpIfNotSmi(eax, &transition_elements_kind); |
} |
@@ -3843,7 +3858,7 @@ void KeyedStoreStubCompiler::GenerateStoreFastElement( |
__ j(not_equal, &miss_force_generic); |
__ bind(&finish_store); |
- if (elements_kind == FAST_SMI_ONLY_ELEMENTS) { |
+ if (IsFastSmiElementsKind(elements_kind)) { |
// ecx is a smi, use times_half_pointer_size instead of |
// times_pointer_size |
__ mov(FieldOperand(edi, |
@@ -3851,7 +3866,7 @@ void KeyedStoreStubCompiler::GenerateStoreFastElement( |
times_half_pointer_size, |
FixedArray::kHeaderSize), eax); |
} else { |
- ASSERT(elements_kind == FAST_ELEMENTS); |
+ ASSERT(IsFastObjectElementsKind(elements_kind)); |
// Do the store and update the write barrier. |
// ecx is a smi, use times_half_pointer_size instead of |
// times_pointer_size |