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