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_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/codegen.h" | 7 #include "src/codegen.h" |
8 #include "src/ic/ic.h" | 8 #include "src/ic/ic.h" |
9 #include "src/ic/ic-compiler.h" | 9 #include "src/ic/ic-compiler.h" |
10 #include "src/ic/stub-cache.h" | 10 #include "src/ic/stub-cache.h" |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 __ Integer32ToSmi(key, key); | 546 __ Integer32ToSmi(key, key); |
547 __ bind(&slow_with_tagged_index); | 547 __ bind(&slow_with_tagged_index); |
548 PropertyICCompiler::GenerateRuntimeSetProperty(masm, language_mode); | 548 PropertyICCompiler::GenerateRuntimeSetProperty(masm, language_mode); |
549 // Never returns to here. | 549 // Never returns to here. |
550 | 550 |
551 __ bind(&maybe_name_key); | 551 __ bind(&maybe_name_key); |
552 __ movp(r9, FieldOperand(key, HeapObject::kMapOffset)); | 552 __ movp(r9, FieldOperand(key, HeapObject::kMapOffset)); |
553 __ movzxbp(r9, FieldOperand(r9, Map::kInstanceTypeOffset)); | 553 __ movzxbp(r9, FieldOperand(r9, Map::kInstanceTypeOffset)); |
554 __ JumpIfNotUniqueNameInstanceType(r9, &slow_with_tagged_index); | 554 __ JumpIfNotUniqueNameInstanceType(r9, &slow_with_tagged_index); |
555 | 555 |
556 Register vector = VectorStoreICDescriptor::VectorRegister(); | 556 Register vector = StoreWithVectorDescriptor::VectorRegister(); |
557 Register slot = VectorStoreICDescriptor::SlotRegister(); | 557 Register slot = StoreWithVectorDescriptor::SlotRegister(); |
558 // The handlers in the stub cache expect a vector and slot. Since we won't | 558 // The handlers in the stub cache expect a vector and slot. Since we won't |
559 // change the IC from any downstream misses, a dummy vector can be used. | 559 // change the IC from any downstream misses, a dummy vector can be used. |
560 Handle<TypeFeedbackVector> dummy_vector = | 560 Handle<TypeFeedbackVector> dummy_vector = |
561 TypeFeedbackVector::DummyVector(masm->isolate()); | 561 TypeFeedbackVector::DummyVector(masm->isolate()); |
562 int slot_index = dummy_vector->GetIndex( | 562 int slot_index = dummy_vector->GetIndex( |
563 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot)); | 563 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot)); |
564 __ Move(vector, dummy_vector); | 564 __ Move(vector, dummy_vector); |
565 __ Move(slot, Smi::FromInt(slot_index)); | 565 __ Move(slot, Smi::FromInt(slot_index)); |
566 | 566 |
567 masm->isolate()->store_stub_cache()->GenerateProbe(masm, receiver, key, r9, | 567 masm->isolate()->store_stub_cache()->GenerateProbe(masm, receiver, key, r9, |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
709 Register receiver = StoreDescriptor::ReceiverRegister(); | 709 Register receiver = StoreDescriptor::ReceiverRegister(); |
710 Register name = StoreDescriptor::NameRegister(); | 710 Register name = StoreDescriptor::NameRegister(); |
711 Register value = StoreDescriptor::ValueRegister(); | 711 Register value = StoreDescriptor::ValueRegister(); |
712 Register temp = r11; | 712 Register temp = r11; |
713 DCHECK(!temp.is(receiver) && !temp.is(name) && !temp.is(value)); | 713 DCHECK(!temp.is(receiver) && !temp.is(name) && !temp.is(value)); |
714 | 714 |
715 __ PopReturnAddressTo(temp); | 715 __ PopReturnAddressTo(temp); |
716 __ Push(receiver); | 716 __ Push(receiver); |
717 __ Push(name); | 717 __ Push(name); |
718 __ Push(value); | 718 __ Push(value); |
719 Register slot = VectorStoreICDescriptor::SlotRegister(); | 719 Register slot = StoreWithVectorDescriptor::SlotRegister(); |
720 Register vector = VectorStoreICDescriptor::VectorRegister(); | 720 Register vector = StoreWithVectorDescriptor::VectorRegister(); |
721 DCHECK(!temp.is(slot) && !temp.is(vector)); | 721 DCHECK(!temp.is(slot) && !temp.is(vector)); |
722 __ Push(slot); | 722 __ Push(slot); |
723 __ Push(vector); | 723 __ Push(vector); |
724 __ PushReturnAddressFrom(temp); | 724 __ PushReturnAddressFrom(temp); |
725 } | 725 } |
726 | 726 |
727 | 727 |
728 void StoreIC::GenerateMiss(MacroAssembler* masm) { | 728 void StoreIC::GenerateMiss(MacroAssembler* masm) { |
729 // Return address is on the stack. | 729 // Return address is on the stack. |
730 StoreIC_PushArgs(masm); | 730 StoreIC_PushArgs(masm); |
731 | 731 |
732 // Perform tail call to the entry. | 732 // Perform tail call to the entry. |
733 __ TailCallRuntime(Runtime::kStoreIC_Miss); | 733 __ TailCallRuntime(Runtime::kStoreIC_Miss); |
734 } | 734 } |
735 | 735 |
736 | 736 |
737 void StoreIC::GenerateNormal(MacroAssembler* masm) { | 737 void StoreIC::GenerateNormal(MacroAssembler* masm) { |
738 Register receiver = StoreDescriptor::ReceiverRegister(); | 738 Register receiver = StoreDescriptor::ReceiverRegister(); |
739 Register name = StoreDescriptor::NameRegister(); | 739 Register name = StoreDescriptor::NameRegister(); |
740 Register value = StoreDescriptor::ValueRegister(); | 740 Register value = StoreDescriptor::ValueRegister(); |
741 Register dictionary = r11; | 741 Register dictionary = r11; |
742 DCHECK(!AreAliased(dictionary, VectorStoreICDescriptor::VectorRegister(), | 742 DCHECK(!AreAliased(dictionary, StoreWithVectorDescriptor::VectorRegister(), |
743 VectorStoreICDescriptor::SlotRegister())); | 743 StoreWithVectorDescriptor::SlotRegister())); |
744 | 744 |
745 Label miss; | 745 Label miss; |
746 | 746 |
747 __ movp(dictionary, FieldOperand(receiver, JSObject::kPropertiesOffset)); | 747 __ movp(dictionary, FieldOperand(receiver, JSObject::kPropertiesOffset)); |
748 GenerateDictionaryStore(masm, &miss, dictionary, name, value, r8, r9); | 748 GenerateDictionaryStore(masm, &miss, dictionary, name, value, r8, r9); |
749 Counters* counters = masm->isolate()->counters(); | 749 Counters* counters = masm->isolate()->counters(); |
750 __ IncrementCounter(counters->ic_store_normal_hit(), 1); | 750 __ IncrementCounter(counters->ic_store_normal_hit(), 1); |
751 __ ret(0); | 751 __ ret(0); |
752 | 752 |
753 __ bind(&miss); | 753 __ bind(&miss); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 Condition cc = | 834 Condition cc = |
835 (check == ENABLE_INLINED_SMI_CHECK) | 835 (check == ENABLE_INLINED_SMI_CHECK) |
836 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) | 836 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) |
837 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); | 837 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); |
838 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 838 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
839 } | 839 } |
840 } // namespace internal | 840 } // namespace internal |
841 } // namespace v8 | 841 } // namespace v8 |
842 | 842 |
843 #endif // V8_TARGET_ARCH_X64 | 843 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |