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 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 void LoadIC::GenerateMiss(MacroAssembler* masm) { | 666 void LoadIC::GenerateMiss(MacroAssembler* masm) { |
667 // The return address is on the stack. | 667 // The return address is on the stack. |
668 | 668 |
669 Counters* counters = masm->isolate()->counters(); | 669 Counters* counters = masm->isolate()->counters(); |
670 __ IncrementCounter(counters->load_miss(), 1); | 670 __ IncrementCounter(counters->load_miss(), 1); |
671 | 671 |
672 LoadIC_PushArgs(masm); | 672 LoadIC_PushArgs(masm); |
673 | 673 |
674 // Perform tail call to the entry. | 674 // Perform tail call to the entry. |
675 int arg_count = 4; | 675 int arg_count = 4; |
676 __ TailCallRuntime(Runtime::kLoadIC_Miss, arg_count, 1); | 676 __ TailCallRuntime(Runtime::kLoadIC_Miss, arg_count); |
677 } | 677 } |
678 | 678 |
679 | 679 |
680 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, | 680 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, |
681 LanguageMode language_mode) { | 681 LanguageMode language_mode) { |
682 // The return address is on the stack. | 682 // The return address is on the stack. |
683 Register receiver = LoadDescriptor::ReceiverRegister(); | 683 Register receiver = LoadDescriptor::ReceiverRegister(); |
684 Register name = LoadDescriptor::NameRegister(); | 684 Register name = LoadDescriptor::NameRegister(); |
685 | 685 |
686 DCHECK(!rbx.is(receiver) && !rbx.is(name)); | 686 DCHECK(!rbx.is(receiver) && !rbx.is(name)); |
687 | 687 |
688 __ PopReturnAddressTo(rbx); | 688 __ PopReturnAddressTo(rbx); |
689 __ Push(receiver); | 689 __ Push(receiver); |
690 __ Push(name); | 690 __ Push(name); |
691 __ PushReturnAddressFrom(rbx); | 691 __ PushReturnAddressFrom(rbx); |
692 | 692 |
693 // Do tail-call to runtime routine. | 693 // Do tail-call to runtime routine. |
694 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kGetPropertyStrong | 694 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kGetPropertyStrong |
695 : Runtime::kGetProperty, | 695 : Runtime::kGetProperty, |
696 2, 1); | 696 2); |
697 } | 697 } |
698 | 698 |
699 | 699 |
700 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { | 700 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { |
701 // The return address is on the stack. | 701 // The return address is on the stack. |
702 Counters* counters = masm->isolate()->counters(); | 702 Counters* counters = masm->isolate()->counters(); |
703 __ IncrementCounter(counters->keyed_load_miss(), 1); | 703 __ IncrementCounter(counters->keyed_load_miss(), 1); |
704 | 704 |
705 LoadIC_PushArgs(masm); | 705 LoadIC_PushArgs(masm); |
706 | 706 |
707 // Perform tail call to the entry. | 707 // Perform tail call to the entry. |
708 int arg_count = 4; | 708 int arg_count = 4; |
709 __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss, arg_count, 1); | 709 __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss, arg_count); |
710 } | 710 } |
711 | 711 |
712 | 712 |
713 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, | 713 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, |
714 LanguageMode language_mode) { | 714 LanguageMode language_mode) { |
715 // The return address is on the stack. | 715 // The return address is on the stack. |
716 Register receiver = LoadDescriptor::ReceiverRegister(); | 716 Register receiver = LoadDescriptor::ReceiverRegister(); |
717 Register name = LoadDescriptor::NameRegister(); | 717 Register name = LoadDescriptor::NameRegister(); |
718 | 718 |
719 DCHECK(!rbx.is(receiver) && !rbx.is(name)); | 719 DCHECK(!rbx.is(receiver) && !rbx.is(name)); |
720 | 720 |
721 __ PopReturnAddressTo(rbx); | 721 __ PopReturnAddressTo(rbx); |
722 __ Push(receiver); | 722 __ Push(receiver); |
723 __ Push(name); | 723 __ Push(name); |
724 __ PushReturnAddressFrom(rbx); | 724 __ PushReturnAddressFrom(rbx); |
725 | 725 |
726 // Do tail-call to runtime routine. | 726 // Do tail-call to runtime routine. |
727 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kKeyedGetPropertyStrong | 727 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kKeyedGetPropertyStrong |
728 : Runtime::kKeyedGetProperty, | 728 : Runtime::kKeyedGetProperty, |
729 2, 1); | 729 2); |
730 } | 730 } |
731 | 731 |
732 | 732 |
733 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { | 733 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { |
734 // This shouldn't be called. | 734 // This shouldn't be called. |
735 __ int3(); | 735 __ int3(); |
736 } | 736 } |
737 | 737 |
738 | 738 |
739 static void StoreIC_PushArgs(MacroAssembler* masm) { | 739 static void StoreIC_PushArgs(MacroAssembler* masm) { |
(...skipping 14 matching lines...) Expand all Loading... |
754 __ Push(vector); | 754 __ Push(vector); |
755 __ PushReturnAddressFrom(temp); | 755 __ PushReturnAddressFrom(temp); |
756 } | 756 } |
757 | 757 |
758 | 758 |
759 void StoreIC::GenerateMiss(MacroAssembler* masm) { | 759 void StoreIC::GenerateMiss(MacroAssembler* masm) { |
760 // Return address is on the stack. | 760 // Return address is on the stack. |
761 StoreIC_PushArgs(masm); | 761 StoreIC_PushArgs(masm); |
762 | 762 |
763 // Perform tail call to the entry. | 763 // Perform tail call to the entry. |
764 __ TailCallRuntime(Runtime::kStoreIC_Miss, 5, 1); | 764 __ TailCallRuntime(Runtime::kStoreIC_Miss, 5); |
765 } | 765 } |
766 | 766 |
767 | 767 |
768 void StoreIC::GenerateNormal(MacroAssembler* masm) { | 768 void StoreIC::GenerateNormal(MacroAssembler* masm) { |
769 Register receiver = StoreDescriptor::ReceiverRegister(); | 769 Register receiver = StoreDescriptor::ReceiverRegister(); |
770 Register name = StoreDescriptor::NameRegister(); | 770 Register name = StoreDescriptor::NameRegister(); |
771 Register value = StoreDescriptor::ValueRegister(); | 771 Register value = StoreDescriptor::ValueRegister(); |
772 Register dictionary = r11; | 772 Register dictionary = r11; |
773 DCHECK(!AreAliased(dictionary, VectorStoreICDescriptor::VectorRegister(), | 773 DCHECK(!AreAliased(dictionary, VectorStoreICDescriptor::VectorRegister(), |
774 VectorStoreICDescriptor::SlotRegister())); | 774 VectorStoreICDescriptor::SlotRegister())); |
(...skipping 10 matching lines...) Expand all Loading... |
785 __ IncrementCounter(counters->store_normal_miss(), 1); | 785 __ IncrementCounter(counters->store_normal_miss(), 1); |
786 GenerateMiss(masm); | 786 GenerateMiss(masm); |
787 } | 787 } |
788 | 788 |
789 | 789 |
790 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { | 790 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { |
791 // Return address is on the stack. | 791 // Return address is on the stack. |
792 StoreIC_PushArgs(masm); | 792 StoreIC_PushArgs(masm); |
793 | 793 |
794 // Do tail-call to runtime routine. | 794 // Do tail-call to runtime routine. |
795 __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss, 5, 1); | 795 __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss, 5); |
796 } | 796 } |
797 | 797 |
798 | 798 |
799 #undef __ | 799 #undef __ |
800 | 800 |
801 | 801 |
802 Condition CompareIC::ComputeCondition(Token::Value op) { | 802 Condition CompareIC::ComputeCondition(Token::Value op) { |
803 switch (op) { | 803 switch (op) { |
804 case Token::EQ_STRICT: | 804 case Token::EQ_STRICT: |
805 case Token::EQ: | 805 case Token::EQ: |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
864 Condition cc = | 864 Condition cc = |
865 (check == ENABLE_INLINED_SMI_CHECK) | 865 (check == ENABLE_INLINED_SMI_CHECK) |
866 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) | 866 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) |
867 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); | 867 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); |
868 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 868 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
869 } | 869 } |
870 } // namespace internal | 870 } // namespace internal |
871 } // namespace v8 | 871 } // namespace v8 |
872 | 872 |
873 #endif // V8_TARGET_ARCH_X64 | 873 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |