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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
8 | 8 |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/ic/ic.h" | 10 #include "src/ic/ic.h" |
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 | 669 |
670 void LoadIC::GenerateMiss(MacroAssembler* masm) { | 670 void LoadIC::GenerateMiss(MacroAssembler* masm) { |
671 // The return address is on the stack. | 671 // The return address is on the stack. |
672 | 672 |
673 Counters* counters = masm->isolate()->counters(); | 673 Counters* counters = masm->isolate()->counters(); |
674 __ IncrementCounter(counters->load_miss(), 1); | 674 __ IncrementCounter(counters->load_miss(), 1); |
675 | 675 |
676 LoadIC_PushArgs(masm); | 676 LoadIC_PushArgs(masm); |
677 | 677 |
678 // Perform tail call to the entry. | 678 // Perform tail call to the entry. |
679 ExternalReference ref = | 679 ExternalReference ref = ExternalReference( |
680 ExternalReference(IC_Utility(kLoadIC_Miss), masm->isolate()); | 680 Runtime::FunctionForId(Runtime::kLoadIC_Miss), masm->isolate()); |
681 int arg_count = 4; | 681 int arg_count = 4; |
682 __ TailCallExternalReference(ref, arg_count, 1); | 682 __ TailCallExternalReference(ref, arg_count, 1); |
683 } | 683 } |
684 | 684 |
685 | 685 |
686 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, | 686 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, |
687 LanguageMode language_mode) { | 687 LanguageMode language_mode) { |
688 // The return address is on the stack. | 688 // The return address is on the stack. |
689 Register receiver = LoadDescriptor::ReceiverRegister(); | 689 Register receiver = LoadDescriptor::ReceiverRegister(); |
690 Register name = LoadDescriptor::NameRegister(); | 690 Register name = LoadDescriptor::NameRegister(); |
(...skipping 13 matching lines...) Expand all Loading... |
704 | 704 |
705 | 705 |
706 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { | 706 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { |
707 // The return address is on the stack. | 707 // The return address is on the stack. |
708 Counters* counters = masm->isolate()->counters(); | 708 Counters* counters = masm->isolate()->counters(); |
709 __ IncrementCounter(counters->keyed_load_miss(), 1); | 709 __ IncrementCounter(counters->keyed_load_miss(), 1); |
710 | 710 |
711 LoadIC_PushArgs(masm); | 711 LoadIC_PushArgs(masm); |
712 | 712 |
713 // Perform tail call to the entry. | 713 // Perform tail call to the entry. |
714 ExternalReference ref = | 714 ExternalReference ref = ExternalReference( |
715 ExternalReference(IC_Utility(kKeyedLoadIC_Miss), masm->isolate()); | 715 Runtime::FunctionForId(Runtime::kKeyedLoadIC_Miss), masm->isolate()); |
716 int arg_count = 4; | 716 int arg_count = 4; |
717 __ TailCallExternalReference(ref, arg_count, 1); | 717 __ TailCallExternalReference(ref, arg_count, 1); |
718 } | 718 } |
719 | 719 |
720 | 720 |
721 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, | 721 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, |
722 LanguageMode language_mode) { | 722 LanguageMode language_mode) { |
723 // The return address is on the stack. | 723 // The return address is on the stack. |
724 Register receiver = LoadDescriptor::ReceiverRegister(); | 724 Register receiver = LoadDescriptor::ReceiverRegister(); |
725 Register name = LoadDescriptor::NameRegister(); | 725 Register name = LoadDescriptor::NameRegister(); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
766 __ Push(value); | 766 __ Push(value); |
767 __ PushReturnAddressFrom(rbx); | 767 __ PushReturnAddressFrom(rbx); |
768 } | 768 } |
769 | 769 |
770 | 770 |
771 void StoreIC::GenerateMiss(MacroAssembler* masm) { | 771 void StoreIC::GenerateMiss(MacroAssembler* masm) { |
772 // Return address is on the stack. | 772 // Return address is on the stack. |
773 StoreIC_PushArgs(masm); | 773 StoreIC_PushArgs(masm); |
774 | 774 |
775 // Perform tail call to the entry. | 775 // Perform tail call to the entry. |
776 ExternalReference ref = | 776 ExternalReference ref = ExternalReference( |
777 ExternalReference(IC_Utility(kStoreIC_Miss), masm->isolate()); | 777 Runtime::FunctionForId(Runtime::kStoreIC_Miss), masm->isolate()); |
778 __ TailCallExternalReference(ref, 3, 1); | 778 __ TailCallExternalReference(ref, 3, 1); |
779 } | 779 } |
780 | 780 |
781 | 781 |
782 void StoreIC::GenerateNormal(MacroAssembler* masm) { | 782 void StoreIC::GenerateNormal(MacroAssembler* masm) { |
783 Register receiver = StoreDescriptor::ReceiverRegister(); | 783 Register receiver = StoreDescriptor::ReceiverRegister(); |
784 Register name = StoreDescriptor::NameRegister(); | 784 Register name = StoreDescriptor::NameRegister(); |
785 Register value = StoreDescriptor::ValueRegister(); | 785 Register value = StoreDescriptor::ValueRegister(); |
786 Register dictionary = rbx; | 786 Register dictionary = rbx; |
787 | 787 |
788 Label miss; | 788 Label miss; |
789 | 789 |
790 __ movp(dictionary, FieldOperand(receiver, JSObject::kPropertiesOffset)); | 790 __ movp(dictionary, FieldOperand(receiver, JSObject::kPropertiesOffset)); |
791 GenerateDictionaryStore(masm, &miss, dictionary, name, value, r8, r9); | 791 GenerateDictionaryStore(masm, &miss, dictionary, name, value, r8, r9); |
792 Counters* counters = masm->isolate()->counters(); | 792 Counters* counters = masm->isolate()->counters(); |
793 __ IncrementCounter(counters->store_normal_hit(), 1); | 793 __ IncrementCounter(counters->store_normal_hit(), 1); |
794 __ ret(0); | 794 __ ret(0); |
795 | 795 |
796 __ bind(&miss); | 796 __ bind(&miss); |
797 __ IncrementCounter(counters->store_normal_miss(), 1); | 797 __ IncrementCounter(counters->store_normal_miss(), 1); |
798 GenerateMiss(masm); | 798 GenerateMiss(masm); |
799 } | 799 } |
800 | 800 |
801 | 801 |
802 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { | 802 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { |
803 // Return address is on the stack. | 803 // Return address is on the stack. |
804 StoreIC_PushArgs(masm); | 804 StoreIC_PushArgs(masm); |
805 | 805 |
806 // Do tail-call to runtime routine. | 806 // Do tail-call to runtime routine. |
807 ExternalReference ref = | 807 ExternalReference ref = ExternalReference( |
808 ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate()); | 808 Runtime::FunctionForId(Runtime::kKeyedStoreIC_Miss), masm->isolate()); |
809 __ TailCallExternalReference(ref, 3, 1); | 809 __ TailCallExternalReference(ref, 3, 1); |
810 } | 810 } |
811 | 811 |
812 | 812 |
813 #undef __ | 813 #undef __ |
814 | 814 |
815 | 815 |
816 Condition CompareIC::ComputeCondition(Token::Value op) { | 816 Condition CompareIC::ComputeCondition(Token::Value op) { |
817 switch (op) { | 817 switch (op) { |
818 case Token::EQ_STRICT: | 818 case Token::EQ_STRICT: |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
877 Condition cc = | 877 Condition cc = |
878 (check == ENABLE_INLINED_SMI_CHECK) | 878 (check == ENABLE_INLINED_SMI_CHECK) |
879 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) | 879 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) |
880 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); | 880 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); |
881 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 881 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
882 } | 882 } |
883 } // namespace internal | 883 } // namespace internal |
884 } // namespace v8 | 884 } // namespace v8 |
885 | 885 |
886 #endif // V8_TARGET_ARCH_X64 | 886 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |