Index: src/x64/stub-cache-x64.cc |
diff --git a/src/x64/stub-cache-x64.cc b/src/x64/stub-cache-x64.cc |
index 5721e9b373169180d64ce58f5734d5099d6274c6..1b8ed3848c2ff1aeb13e5f2c5286b367e2c47ac7 100644 |
--- a/src/x64/stub-cache-x64.cc |
+++ b/src/x64/stub-cache-x64.cc |
@@ -1434,17 +1434,32 @@ Handle<Code> CallStubCompiler::CompileArrayPushCall( |
__ jmp(&fast_object); |
// In case of fast smi-only, convert to fast object, otherwise bail out. |
__ bind(¬_fast_object); |
- __ CheckFastSmiOnlyElements(rbx, &call_builtin); |
+ __ CheckFastSmiElements(rbx, &call_builtin); |
// rdx: receiver |
// rbx: map |
- __ movq(r9, rdi); // Backup rdi as it is going to be trashed. |
- __ LoadTransitionedArrayMapConditional(FAST_SMI_ONLY_ELEMENTS, |
+ |
+ Label try_holey_map; |
+ __ LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS, |
FAST_ELEMENTS, |
rbx, |
rdi, |
+ &try_holey_map); |
+ |
+ ElementsTransitionGenerator:: |
+ GenerateMapChangeElementsTransition(masm()); |
+ // Restore edi. |
+ __ movq(rdi, FieldOperand(rdx, JSArray::kElementsOffset)); |
+ __ jmp(&fast_object); |
+ |
+ __ bind(&try_holey_map); |
+ __ LoadTransitionedArrayMapConditional(FAST_HOLEY_SMI_ELEMENTS, |
+ FAST_HOLEY_ELEMENTS, |
+ rbx, |
+ rdi, |
&call_builtin); |
- ElementsTransitionGenerator::GenerateSmiOnlyToObject(masm()); |
- __ movq(rdi, r9); |
+ ElementsTransitionGenerator:: |
+ GenerateMapChangeElementsTransition(masm()); |
+ __ movq(rdi, FieldOperand(rdx, JSArray::kElementsOffset)); |
__ bind(&fast_object); |
} else { |
__ CheckFastObjectElements(rbx, &call_builtin); |
@@ -3369,8 +3384,11 @@ void KeyedStoreStubCompiler::GenerateStoreExternalArray( |
__ movsd(Operand(rbx, rdi, times_8, 0), xmm0); |
break; |
case FAST_ELEMENTS: |
- case FAST_SMI_ONLY_ELEMENTS: |
+ case FAST_SMI_ELEMENTS: |
case FAST_DOUBLE_ELEMENTS: |
+ case FAST_HOLEY_ELEMENTS: |
+ case FAST_HOLEY_SMI_ELEMENTS: |
+ case FAST_HOLEY_DOUBLE_ELEMENTS: |
case DICTIONARY_ELEMENTS: |
case NON_STRICT_ARGUMENTS_ELEMENTS: |
UNREACHABLE(); |
@@ -3435,8 +3453,11 @@ void KeyedStoreStubCompiler::GenerateStoreExternalArray( |
case EXTERNAL_FLOAT_ELEMENTS: |
case EXTERNAL_DOUBLE_ELEMENTS: |
case FAST_ELEMENTS: |
- case FAST_SMI_ONLY_ELEMENTS: |
+ case FAST_SMI_ELEMENTS: |
case FAST_DOUBLE_ELEMENTS: |
+ case FAST_HOLEY_ELEMENTS: |
+ case FAST_HOLEY_SMI_ELEMENTS: |
+ case FAST_HOLEY_DOUBLE_ELEMENTS: |
case DICTIONARY_ELEMENTS: |
case NON_STRICT_ARGUMENTS_ELEMENTS: |
UNREACHABLE(); |
@@ -3587,7 +3608,7 @@ void KeyedStoreStubCompiler::GenerateStoreFastElement( |
// Check that the key is a smi or a heap number convertible to a smi. |
GenerateSmiKeyCheck(masm, rcx, rbx, xmm0, xmm1, &miss_force_generic); |
- if (elements_kind == FAST_SMI_ONLY_ELEMENTS) { |
+ if (IsFastSmiElementsKind(elements_kind)) { |
__ JumpIfNotSmi(rax, &transition_elements_kind); |
} |
@@ -3611,13 +3632,13 @@ void KeyedStoreStubCompiler::GenerateStoreFastElement( |
__ j(not_equal, &miss_force_generic); |
__ bind(&finish_store); |
- if (elements_kind == FAST_SMI_ONLY_ELEMENTS) { |
+ if (IsFastSmiElementsKind(elements_kind)) { |
__ SmiToInteger32(rcx, rcx); |
__ movq(FieldOperand(rdi, rcx, times_pointer_size, FixedArray::kHeaderSize), |
rax); |
} else { |
// Do the store and update the write barrier. |
- ASSERT(elements_kind == FAST_ELEMENTS); |
+ ASSERT(IsFastObjectElementsKind(elements_kind)); |
__ SmiToInteger32(rcx, rcx); |
__ lea(rcx, |
FieldOperand(rdi, rcx, times_pointer_size, FixedArray::kHeaderSize)); |