Chromium Code Reviews| 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..746bc533ad2f81e409b34fd901963168eb8a80bf 100644 |
| --- a/src/x64/stub-cache-x64.cc |
| +++ b/src/x64/stub-cache-x64.cc |
| @@ -1434,16 +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:: |
| + GenerateMapChangeElementTransition(masm()); |
| + // Restore edi. |
| + __ movq(rdi, FieldOperand(rdx, JSArray::kElementsOffset)); |
|
Jakob Kummerow
2012/05/22 17:36:49
You have rdi's original value in r9, can use that
danno
2012/05/23 14:25:36
Done.
|
| + __ jmp(&fast_object); |
| + |
| + __ bind(&try_holey_map); |
| + __ LoadTransitionedArrayMapConditional(FAST_HOLEY_SMI_ELEMENTS, |
| + FAST_HOLEY_ELEMENTS, |
| + rbx, |
| + rdi, |
| &call_builtin); |
| - ElementsTransitionGenerator::GenerateSmiOnlyToObject(masm()); |
| + ElementsTransitionGenerator:: |
| + GenerateMapChangeElementTransition(masm()); |
| __ movq(rdi, r9); |
| __ bind(&fast_object); |
| } else { |
| @@ -3369,8 +3385,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 +3454,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 +3609,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 +3633,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)); |