OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_X64 | 5 #if V8_TARGET_ARCH_X64 |
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/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 3453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3464 &miss); | 3464 &miss); |
3465 | 3465 |
3466 __ bind(&miss); | 3466 __ bind(&miss); |
3467 KeyedLoadIC::GenerateMiss(masm); | 3467 KeyedLoadIC::GenerateMiss(masm); |
3468 | 3468 |
3469 __ bind(&load_smi_map); | 3469 __ bind(&load_smi_map); |
3470 __ LoadRoot(receiver_map, Heap::kHeapNumberMapRootIndex); | 3470 __ LoadRoot(receiver_map, Heap::kHeapNumberMapRootIndex); |
3471 __ jmp(&compare_map); | 3471 __ jmp(&compare_map); |
3472 } | 3472 } |
3473 | 3473 |
3474 | 3474 void StoreICTrampolineStub::Generate(MacroAssembler* masm) { |
3475 void VectorStoreICTrampolineStub::Generate(MacroAssembler* masm) { | |
3476 __ EmitLoadTypeFeedbackVector(VectorStoreICDescriptor::VectorRegister()); | 3475 __ EmitLoadTypeFeedbackVector(VectorStoreICDescriptor::VectorRegister()); |
3477 VectorStoreICStub stub(isolate(), state()); | 3476 StoreICStub stub(isolate(), state()); |
3478 stub.GenerateForTrampoline(masm); | 3477 stub.GenerateForTrampoline(masm); |
3479 } | 3478 } |
3480 | 3479 |
3481 | 3480 void KeyedStoreICTrampolineStub::Generate(MacroAssembler* masm) { |
3482 void VectorKeyedStoreICTrampolineStub::Generate(MacroAssembler* masm) { | |
3483 __ EmitLoadTypeFeedbackVector(VectorStoreICDescriptor::VectorRegister()); | 3481 __ EmitLoadTypeFeedbackVector(VectorStoreICDescriptor::VectorRegister()); |
3484 VectorKeyedStoreICStub stub(isolate(), state()); | 3482 KeyedStoreICStub stub(isolate(), state()); |
3485 stub.GenerateForTrampoline(masm); | 3483 stub.GenerateForTrampoline(masm); |
3486 } | 3484 } |
3487 | 3485 |
| 3486 void StoreICStub::Generate(MacroAssembler* masm) { GenerateImpl(masm, false); } |
3488 | 3487 |
3489 void VectorStoreICStub::Generate(MacroAssembler* masm) { | 3488 void StoreICStub::GenerateForTrampoline(MacroAssembler* masm) { |
3490 GenerateImpl(masm, false); | |
3491 } | |
3492 | |
3493 | |
3494 void VectorStoreICStub::GenerateForTrampoline(MacroAssembler* masm) { | |
3495 GenerateImpl(masm, true); | 3489 GenerateImpl(masm, true); |
3496 } | 3490 } |
3497 | 3491 |
3498 | 3492 void StoreICStub::GenerateImpl(MacroAssembler* masm, bool in_frame) { |
3499 void VectorStoreICStub::GenerateImpl(MacroAssembler* masm, bool in_frame) { | |
3500 Register receiver = VectorStoreICDescriptor::ReceiverRegister(); // rdx | 3493 Register receiver = VectorStoreICDescriptor::ReceiverRegister(); // rdx |
3501 Register key = VectorStoreICDescriptor::NameRegister(); // rcx | 3494 Register key = VectorStoreICDescriptor::NameRegister(); // rcx |
3502 Register vector = VectorStoreICDescriptor::VectorRegister(); // rbx | 3495 Register vector = VectorStoreICDescriptor::VectorRegister(); // rbx |
3503 Register slot = VectorStoreICDescriptor::SlotRegister(); // rdi | 3496 Register slot = VectorStoreICDescriptor::SlotRegister(); // rdi |
3504 DCHECK(VectorStoreICDescriptor::ValueRegister().is(rax)); // rax | 3497 DCHECK(VectorStoreICDescriptor::ValueRegister().is(rax)); // rax |
3505 Register feedback = r8; | 3498 Register feedback = r8; |
3506 Register integer_slot = r9; | 3499 Register integer_slot = r9; |
3507 Register receiver_map = r11; | 3500 Register receiver_map = r11; |
3508 DCHECK(!AreAliased(feedback, integer_slot, vector, slot, receiver_map)); | 3501 DCHECK(!AreAliased(feedback, integer_slot, vector, slot, receiver_map)); |
3509 | 3502 |
(...skipping 24 matching lines...) Expand all Loading... |
3534 feedback, no_reg); | 3527 feedback, no_reg); |
3535 | 3528 |
3536 __ bind(&miss); | 3529 __ bind(&miss); |
3537 StoreIC::GenerateMiss(masm); | 3530 StoreIC::GenerateMiss(masm); |
3538 | 3531 |
3539 __ bind(&load_smi_map); | 3532 __ bind(&load_smi_map); |
3540 __ LoadRoot(receiver_map, Heap::kHeapNumberMapRootIndex); | 3533 __ LoadRoot(receiver_map, Heap::kHeapNumberMapRootIndex); |
3541 __ jmp(&compare_map); | 3534 __ jmp(&compare_map); |
3542 } | 3535 } |
3543 | 3536 |
3544 | 3537 void KeyedStoreICStub::Generate(MacroAssembler* masm) { |
3545 void VectorKeyedStoreICStub::Generate(MacroAssembler* masm) { | |
3546 GenerateImpl(masm, false); | 3538 GenerateImpl(masm, false); |
3547 } | 3539 } |
3548 | 3540 |
3549 | 3541 void KeyedStoreICStub::GenerateForTrampoline(MacroAssembler* masm) { |
3550 void VectorKeyedStoreICStub::GenerateForTrampoline(MacroAssembler* masm) { | |
3551 GenerateImpl(masm, true); | 3542 GenerateImpl(masm, true); |
3552 } | 3543 } |
3553 | 3544 |
3554 | 3545 |
3555 static void HandlePolymorphicKeyedStoreCase(MacroAssembler* masm, | 3546 static void HandlePolymorphicKeyedStoreCase(MacroAssembler* masm, |
3556 Register receiver_map, | 3547 Register receiver_map, |
3557 Register feedback, Register scratch, | 3548 Register feedback, Register scratch, |
3558 Register scratch1, | 3549 Register scratch1, |
3559 Register scratch2, Label* miss) { | 3550 Register scratch2, Label* miss) { |
3560 // feedback initially contains the feedback array | 3551 // feedback initially contains the feedback array |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3597 | 3588 |
3598 __ bind(&prepare_next); | 3589 __ bind(&prepare_next); |
3599 __ addl(counter, Immediate(3)); | 3590 __ addl(counter, Immediate(3)); |
3600 __ cmpl(counter, length); | 3591 __ cmpl(counter, length); |
3601 __ j(less, &next_loop); | 3592 __ j(less, &next_loop); |
3602 | 3593 |
3603 // We exhausted our array of map handler pairs. | 3594 // We exhausted our array of map handler pairs. |
3604 __ jmp(miss); | 3595 __ jmp(miss); |
3605 } | 3596 } |
3606 | 3597 |
3607 | 3598 void KeyedStoreICStub::GenerateImpl(MacroAssembler* masm, bool in_frame) { |
3608 void VectorKeyedStoreICStub::GenerateImpl(MacroAssembler* masm, bool in_frame) { | |
3609 Register receiver = VectorStoreICDescriptor::ReceiverRegister(); // rdx | 3599 Register receiver = VectorStoreICDescriptor::ReceiverRegister(); // rdx |
3610 Register key = VectorStoreICDescriptor::NameRegister(); // rcx | 3600 Register key = VectorStoreICDescriptor::NameRegister(); // rcx |
3611 Register vector = VectorStoreICDescriptor::VectorRegister(); // rbx | 3601 Register vector = VectorStoreICDescriptor::VectorRegister(); // rbx |
3612 Register slot = VectorStoreICDescriptor::SlotRegister(); // rdi | 3602 Register slot = VectorStoreICDescriptor::SlotRegister(); // rdi |
3613 DCHECK(VectorStoreICDescriptor::ValueRegister().is(rax)); // rax | 3603 DCHECK(VectorStoreICDescriptor::ValueRegister().is(rax)); // rax |
3614 Register feedback = r8; | 3604 Register feedback = r8; |
3615 Register integer_slot = r9; | 3605 Register integer_slot = r9; |
3616 Register receiver_map = r11; | 3606 Register receiver_map = r11; |
3617 DCHECK(!AreAliased(feedback, integer_slot, vector, slot, receiver_map)); | 3607 DCHECK(!AreAliased(feedback, integer_slot, vector, slot, receiver_map)); |
3618 | 3608 |
(...skipping 1596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5215 kStackUnwindSpace, nullptr, return_value_operand, | 5205 kStackUnwindSpace, nullptr, return_value_operand, |
5216 NULL); | 5206 NULL); |
5217 } | 5207 } |
5218 | 5208 |
5219 #undef __ | 5209 #undef __ |
5220 | 5210 |
5221 } // namespace internal | 5211 } // namespace internal |
5222 } // namespace v8 | 5212 } // namespace v8 |
5223 | 5213 |
5224 #endif // V8_TARGET_ARCH_X64 | 5214 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |