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_X87 | 7 #if V8_TARGET_ARCH_X87 |
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 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
671 __ push(edi); | 671 __ push(edi); |
672 } | 672 } |
673 | 673 |
674 | 674 |
675 void LoadIC::GenerateMiss(MacroAssembler* masm) { | 675 void LoadIC::GenerateMiss(MacroAssembler* masm) { |
676 // Return address is on the stack. | 676 // Return address is on the stack. |
677 __ IncrementCounter(masm->isolate()->counters()->load_miss(), 1); | 677 __ IncrementCounter(masm->isolate()->counters()->load_miss(), 1); |
678 LoadIC_PushArgs(masm); | 678 LoadIC_PushArgs(masm); |
679 | 679 |
680 // Perform tail call to the entry. | 680 // Perform tail call to the entry. |
681 ExternalReference ref = | |
682 ExternalReference(IC_Utility(kLoadIC_Miss), masm->isolate()); | |
683 int arg_count = 4; | 681 int arg_count = 4; |
684 __ TailCallExternalReference(ref, arg_count, 1); | 682 __ TailCallRuntime(Runtime::kLoadIC_Miss, arg_count, 1); |
685 } | 683 } |
686 | 684 |
687 | 685 |
688 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, | 686 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, |
689 LanguageMode language_mode) { | 687 LanguageMode language_mode) { |
690 // Return address is on the stack. | 688 // Return address is on the stack. |
691 Register receiver = LoadDescriptor::ReceiverRegister(); | 689 Register receiver = LoadDescriptor::ReceiverRegister(); |
692 Register name = LoadDescriptor::NameRegister(); | 690 Register name = LoadDescriptor::NameRegister(); |
693 DCHECK(!ebx.is(receiver) && !ebx.is(name)); | 691 DCHECK(!ebx.is(receiver) && !ebx.is(name)); |
694 | 692 |
695 __ pop(ebx); | 693 __ pop(ebx); |
696 __ push(receiver); | 694 __ push(receiver); |
697 __ push(name); | 695 __ push(name); |
698 __ push(ebx); | 696 __ push(ebx); |
699 | 697 |
700 // Do tail-call to runtime routine. | 698 // Do tail-call to runtime routine. |
701 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kGetPropertyStrong | 699 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kGetPropertyStrong |
702 : Runtime::kGetProperty, | 700 : Runtime::kGetProperty, |
703 2, 1); | 701 2, 1); |
704 } | 702 } |
705 | 703 |
706 | 704 |
707 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { | 705 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { |
708 // Return address is on the stack. | 706 // Return address is on the stack. |
709 __ IncrementCounter(masm->isolate()->counters()->keyed_load_miss(), 1); | 707 __ IncrementCounter(masm->isolate()->counters()->keyed_load_miss(), 1); |
710 | 708 |
711 LoadIC_PushArgs(masm); | 709 LoadIC_PushArgs(masm); |
712 | 710 |
713 // Perform tail call to the entry. | 711 // Perform tail call to the entry. |
714 ExternalReference ref = | |
715 ExternalReference(IC_Utility(kKeyedLoadIC_Miss), masm->isolate()); | |
716 int arg_count = 4; | 712 int arg_count = 4; |
717 __ TailCallExternalReference(ref, arg_count, 1); | 713 __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss, arg_count, 1); |
718 } | 714 } |
719 | 715 |
720 | 716 |
721 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, | 717 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, |
722 LanguageMode language_mode) { | 718 LanguageMode language_mode) { |
723 // Return address is on the stack. | 719 // Return address is on the stack. |
724 Register receiver = LoadDescriptor::ReceiverRegister(); | 720 Register receiver = LoadDescriptor::ReceiverRegister(); |
725 Register name = LoadDescriptor::NameRegister(); | 721 Register name = LoadDescriptor::NameRegister(); |
726 DCHECK(!ebx.is(receiver) && !ebx.is(name)); | 722 DCHECK(!ebx.is(receiver) && !ebx.is(name)); |
727 | 723 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
763 __ push(value); | 759 __ push(value); |
764 __ push(ebx); | 760 __ push(ebx); |
765 } | 761 } |
766 | 762 |
767 | 763 |
768 void StoreIC::GenerateMiss(MacroAssembler* masm) { | 764 void StoreIC::GenerateMiss(MacroAssembler* masm) { |
769 // Return address is on the stack. | 765 // Return address is on the stack. |
770 StoreIC_PushArgs(masm); | 766 StoreIC_PushArgs(masm); |
771 | 767 |
772 // Perform tail call to the entry. | 768 // Perform tail call to the entry. |
773 ExternalReference ref = | 769 __ TailCallRuntime(Runtime::kStoreIC_Miss, 3, 1); |
774 ExternalReference(IC_Utility(kStoreIC_Miss), masm->isolate()); | |
775 __ TailCallExternalReference(ref, 3, 1); | |
776 } | 770 } |
777 | 771 |
778 | 772 |
779 void StoreIC::GenerateNormal(MacroAssembler* masm) { | 773 void StoreIC::GenerateNormal(MacroAssembler* masm) { |
780 Label restore_miss; | 774 Label restore_miss; |
781 Register receiver = StoreDescriptor::ReceiverRegister(); | 775 Register receiver = StoreDescriptor::ReceiverRegister(); |
782 Register name = StoreDescriptor::NameRegister(); | 776 Register name = StoreDescriptor::NameRegister(); |
783 Register value = StoreDescriptor::ValueRegister(); | 777 Register value = StoreDescriptor::ValueRegister(); |
784 Register dictionary = ebx; | 778 Register dictionary = ebx; |
785 | 779 |
(...skipping 15 matching lines...) Expand all Loading... |
801 __ IncrementCounter(counters->store_normal_miss(), 1); | 795 __ IncrementCounter(counters->store_normal_miss(), 1); |
802 GenerateMiss(masm); | 796 GenerateMiss(masm); |
803 } | 797 } |
804 | 798 |
805 | 799 |
806 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { | 800 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { |
807 // Return address is on the stack. | 801 // Return address is on the stack. |
808 StoreIC_PushArgs(masm); | 802 StoreIC_PushArgs(masm); |
809 | 803 |
810 // Do tail-call to runtime routine. | 804 // Do tail-call to runtime routine. |
811 ExternalReference ref = | 805 __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss, 3, 1); |
812 ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate()); | |
813 __ TailCallExternalReference(ref, 3, 1); | |
814 } | 806 } |
815 | 807 |
816 | 808 |
817 #undef __ | 809 #undef __ |
818 | 810 |
819 | 811 |
820 Condition CompareIC::ComputeCondition(Token::Value op) { | 812 Condition CompareIC::ComputeCondition(Token::Value op) { |
821 switch (op) { | 813 switch (op) { |
822 case Token::EQ_STRICT: | 814 case Token::EQ_STRICT: |
823 case Token::EQ: | 815 case Token::EQ: |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
881 Condition cc = | 873 Condition cc = |
882 (check == ENABLE_INLINED_SMI_CHECK) | 874 (check == ENABLE_INLINED_SMI_CHECK) |
883 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) | 875 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) |
884 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); | 876 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); |
885 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 877 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
886 } | 878 } |
887 } // namespace internal | 879 } // namespace internal |
888 } // namespace v8 | 880 } // namespace v8 |
889 | 881 |
890 #endif // V8_TARGET_ARCH_X87 | 882 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |