| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #if V8_TARGET_ARCH_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
| 6 | 6 |
| 7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
| 8 #include "src/api-arguments.h" | 8 #include "src/api-arguments.h" |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
| (...skipping 3534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3545 // If the name comparison succeeded, we know we have a fixed array with | 3545 // If the name comparison succeeded, we know we have a fixed array with |
| 3546 // at least one map/handler pair. | 3546 // at least one map/handler pair. |
| 3547 __ mov(feedback, FieldOperand(vector, slot, times_half_pointer_size, | 3547 __ mov(feedback, FieldOperand(vector, slot, times_half_pointer_size, |
| 3548 FixedArray::kHeaderSize + kPointerSize)); | 3548 FixedArray::kHeaderSize + kPointerSize)); |
| 3549 HandleArrayCases(masm, receiver, key, vector, slot, feedback, false, &miss); | 3549 HandleArrayCases(masm, receiver, key, vector, slot, feedback, false, &miss); |
| 3550 | 3550 |
| 3551 __ bind(&miss); | 3551 __ bind(&miss); |
| 3552 KeyedLoadIC::GenerateMiss(masm); | 3552 KeyedLoadIC::GenerateMiss(masm); |
| 3553 } | 3553 } |
| 3554 | 3554 |
| 3555 | 3555 void StoreICTrampolineStub::Generate(MacroAssembler* masm) { |
| 3556 void VectorStoreICTrampolineStub::Generate(MacroAssembler* masm) { | |
| 3557 __ EmitLoadTypeFeedbackVector(VectorStoreICDescriptor::VectorRegister()); | 3556 __ EmitLoadTypeFeedbackVector(VectorStoreICDescriptor::VectorRegister()); |
| 3558 VectorStoreICStub stub(isolate(), state()); | 3557 StoreICStub stub(isolate(), state()); |
| 3559 stub.GenerateForTrampoline(masm); | 3558 stub.GenerateForTrampoline(masm); |
| 3560 } | 3559 } |
| 3561 | 3560 |
| 3562 | 3561 void KeyedStoreICTrampolineStub::Generate(MacroAssembler* masm) { |
| 3563 void VectorKeyedStoreICTrampolineStub::Generate(MacroAssembler* masm) { | |
| 3564 __ EmitLoadTypeFeedbackVector(VectorStoreICDescriptor::VectorRegister()); | 3562 __ EmitLoadTypeFeedbackVector(VectorStoreICDescriptor::VectorRegister()); |
| 3565 VectorKeyedStoreICStub stub(isolate(), state()); | 3563 KeyedStoreICStub stub(isolate(), state()); |
| 3566 stub.GenerateForTrampoline(masm); | 3564 stub.GenerateForTrampoline(masm); |
| 3567 } | 3565 } |
| 3568 | 3566 |
| 3567 void StoreICStub::Generate(MacroAssembler* masm) { GenerateImpl(masm, false); } |
| 3569 | 3568 |
| 3570 void VectorStoreICStub::Generate(MacroAssembler* masm) { | 3569 void StoreICStub::GenerateForTrampoline(MacroAssembler* masm) { |
| 3571 GenerateImpl(masm, false); | |
| 3572 } | |
| 3573 | |
| 3574 | |
| 3575 void VectorStoreICStub::GenerateForTrampoline(MacroAssembler* masm) { | |
| 3576 GenerateImpl(masm, true); | 3570 GenerateImpl(masm, true); |
| 3577 } | 3571 } |
| 3578 | 3572 |
| 3579 | 3573 |
| 3580 // value is on the stack already. | 3574 // value is on the stack already. |
| 3581 static void HandlePolymorphicStoreCase(MacroAssembler* masm, Register receiver, | 3575 static void HandlePolymorphicStoreCase(MacroAssembler* masm, Register receiver, |
| 3582 Register key, Register vector, | 3576 Register key, Register vector, |
| 3583 Register slot, Register feedback, | 3577 Register slot, Register feedback, |
| 3584 bool is_polymorphic, Label* miss) { | 3578 bool is_polymorphic, Label* miss) { |
| 3585 // feedback initially contains the feedback array | 3579 // feedback initially contains the feedback array |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3701 __ j(not_equal, miss); | 3695 __ j(not_equal, miss); |
| 3702 __ mov(weak_cell, FieldOperand(vector, slot, times_half_pointer_size, | 3696 __ mov(weak_cell, FieldOperand(vector, slot, times_half_pointer_size, |
| 3703 FixedArray::kHeaderSize + kPointerSize)); | 3697 FixedArray::kHeaderSize + kPointerSize)); |
| 3704 __ lea(weak_cell, FieldOperand(weak_cell, Code::kHeaderSize)); | 3698 __ lea(weak_cell, FieldOperand(weak_cell, Code::kHeaderSize)); |
| 3705 __ mov(Operand::StaticVariable(virtual_register), weak_cell); | 3699 __ mov(Operand::StaticVariable(virtual_register), weak_cell); |
| 3706 __ pop(weak_cell); // Pop "value". | 3700 __ pop(weak_cell); // Pop "value". |
| 3707 // jump to the handler. | 3701 // jump to the handler. |
| 3708 __ jmp(Operand::StaticVariable(virtual_register)); | 3702 __ jmp(Operand::StaticVariable(virtual_register)); |
| 3709 } | 3703 } |
| 3710 | 3704 |
| 3711 | 3705 void StoreICStub::GenerateImpl(MacroAssembler* masm, bool in_frame) { |
| 3712 void VectorStoreICStub::GenerateImpl(MacroAssembler* masm, bool in_frame) { | |
| 3713 Register receiver = VectorStoreICDescriptor::ReceiverRegister(); // edx | 3706 Register receiver = VectorStoreICDescriptor::ReceiverRegister(); // edx |
| 3714 Register key = VectorStoreICDescriptor::NameRegister(); // ecx | 3707 Register key = VectorStoreICDescriptor::NameRegister(); // ecx |
| 3715 Register value = VectorStoreICDescriptor::ValueRegister(); // eax | 3708 Register value = VectorStoreICDescriptor::ValueRegister(); // eax |
| 3716 Register vector = VectorStoreICDescriptor::VectorRegister(); // ebx | 3709 Register vector = VectorStoreICDescriptor::VectorRegister(); // ebx |
| 3717 Register slot = VectorStoreICDescriptor::SlotRegister(); // edi | 3710 Register slot = VectorStoreICDescriptor::SlotRegister(); // edi |
| 3718 Label miss; | 3711 Label miss; |
| 3719 | 3712 |
| 3720 __ push(value); | 3713 __ push(value); |
| 3721 | 3714 |
| 3722 Register scratch = value; | 3715 Register scratch = value; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 3750 __ pop(slot); | 3743 __ pop(slot); |
| 3751 Label no_pop_miss; | 3744 Label no_pop_miss; |
| 3752 __ jmp(&no_pop_miss); | 3745 __ jmp(&no_pop_miss); |
| 3753 | 3746 |
| 3754 __ bind(&miss); | 3747 __ bind(&miss); |
| 3755 __ pop(value); | 3748 __ pop(value); |
| 3756 __ bind(&no_pop_miss); | 3749 __ bind(&no_pop_miss); |
| 3757 StoreIC::GenerateMiss(masm); | 3750 StoreIC::GenerateMiss(masm); |
| 3758 } | 3751 } |
| 3759 | 3752 |
| 3760 | 3753 void KeyedStoreICStub::Generate(MacroAssembler* masm) { |
| 3761 void VectorKeyedStoreICStub::Generate(MacroAssembler* masm) { | |
| 3762 GenerateImpl(masm, false); | 3754 GenerateImpl(masm, false); |
| 3763 } | 3755 } |
| 3764 | 3756 |
| 3765 | 3757 void KeyedStoreICStub::GenerateForTrampoline(MacroAssembler* masm) { |
| 3766 void VectorKeyedStoreICStub::GenerateForTrampoline(MacroAssembler* masm) { | |
| 3767 GenerateImpl(masm, true); | 3758 GenerateImpl(masm, true); |
| 3768 } | 3759 } |
| 3769 | 3760 |
| 3770 | 3761 |
| 3771 static void HandlePolymorphicKeyedStoreCase(MacroAssembler* masm, | 3762 static void HandlePolymorphicKeyedStoreCase(MacroAssembler* masm, |
| 3772 Register receiver, Register key, | 3763 Register receiver, Register key, |
| 3773 Register vector, Register slot, | 3764 Register vector, Register slot, |
| 3774 Register feedback, Label* miss) { | 3765 Register feedback, Label* miss) { |
| 3775 // feedback initially contains the feedback array | 3766 // feedback initially contains the feedback array |
| 3776 Label next, next_loop, prepare_next; | 3767 Label next, next_loop, prepare_next; |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3869 __ pop(key); | 3860 __ pop(key); |
| 3870 __ pop(vector); | 3861 __ pop(vector); |
| 3871 __ pop(receiver); | 3862 __ pop(receiver); |
| 3872 __ jmp(miss); | 3863 __ jmp(miss); |
| 3873 | 3864 |
| 3874 __ bind(&load_smi_map); | 3865 __ bind(&load_smi_map); |
| 3875 __ LoadRoot(receiver_map, Heap::kHeapNumberMapRootIndex); | 3866 __ LoadRoot(receiver_map, Heap::kHeapNumberMapRootIndex); |
| 3876 __ jmp(&compare_map); | 3867 __ jmp(&compare_map); |
| 3877 } | 3868 } |
| 3878 | 3869 |
| 3879 | 3870 void KeyedStoreICStub::GenerateImpl(MacroAssembler* masm, bool in_frame) { |
| 3880 void VectorKeyedStoreICStub::GenerateImpl(MacroAssembler* masm, bool in_frame) { | |
| 3881 Register receiver = VectorStoreICDescriptor::ReceiverRegister(); // edx | 3871 Register receiver = VectorStoreICDescriptor::ReceiverRegister(); // edx |
| 3882 Register key = VectorStoreICDescriptor::NameRegister(); // ecx | 3872 Register key = VectorStoreICDescriptor::NameRegister(); // ecx |
| 3883 Register value = VectorStoreICDescriptor::ValueRegister(); // eax | 3873 Register value = VectorStoreICDescriptor::ValueRegister(); // eax |
| 3884 Register vector = VectorStoreICDescriptor::VectorRegister(); // ebx | 3874 Register vector = VectorStoreICDescriptor::VectorRegister(); // ebx |
| 3885 Register slot = VectorStoreICDescriptor::SlotRegister(); // edi | 3875 Register slot = VectorStoreICDescriptor::SlotRegister(); // edi |
| 3886 Label miss; | 3876 Label miss; |
| 3887 | 3877 |
| 3888 __ push(value); | 3878 __ push(value); |
| 3889 | 3879 |
| 3890 Register scratch = value; | 3880 Register scratch = value; |
| (...skipping 1606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5497 kStackUnwindSpace, nullptr, return_value_operand, | 5487 kStackUnwindSpace, nullptr, return_value_operand, |
| 5498 NULL); | 5488 NULL); |
| 5499 } | 5489 } |
| 5500 | 5490 |
| 5501 #undef __ | 5491 #undef __ |
| 5502 | 5492 |
| 5503 } // namespace internal | 5493 } // namespace internal |
| 5504 } // namespace v8 | 5494 } // namespace v8 |
| 5505 | 5495 |
| 5506 #endif // V8_TARGET_ARCH_IA32 | 5496 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |