| 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_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
| 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 ExternalReference ref = ExternalReference( |
| 774 ExternalReference(IC_Utility(kStoreIC_Miss), masm->isolate()); | 770 Runtime::FunctionForId(Runtime::kStoreIC_Miss), masm->isolate()); |
| 775 __ TailCallExternalReference(ref, 3, 1); | 771 __ TailCallExternalReference(ref, 3, 1); |
| 776 } | 772 } |
| 777 | 773 |
| 778 | 774 |
| 779 void StoreIC::GenerateNormal(MacroAssembler* masm) { | 775 void StoreIC::GenerateNormal(MacroAssembler* masm) { |
| 780 Label restore_miss; | 776 Label restore_miss; |
| 781 Register receiver = StoreDescriptor::ReceiverRegister(); | 777 Register receiver = StoreDescriptor::ReceiverRegister(); |
| 782 Register name = StoreDescriptor::NameRegister(); | 778 Register name = StoreDescriptor::NameRegister(); |
| 783 Register value = StoreDescriptor::ValueRegister(); | 779 Register value = StoreDescriptor::ValueRegister(); |
| 784 Register dictionary = ebx; | 780 Register dictionary = ebx; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 801 __ IncrementCounter(counters->store_normal_miss(), 1); | 797 __ IncrementCounter(counters->store_normal_miss(), 1); |
| 802 GenerateMiss(masm); | 798 GenerateMiss(masm); |
| 803 } | 799 } |
| 804 | 800 |
| 805 | 801 |
| 806 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { | 802 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { |
| 807 // Return address is on the stack. | 803 // Return address is on the stack. |
| 808 StoreIC_PushArgs(masm); | 804 StoreIC_PushArgs(masm); |
| 809 | 805 |
| 810 // Do tail-call to runtime routine. | 806 // Do tail-call to runtime routine. |
| 811 ExternalReference ref = | 807 ExternalReference ref = ExternalReference( |
| 812 ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate()); | 808 Runtime::FunctionForId(Runtime::kKeyedStoreIC_Miss), masm->isolate()); |
| 813 __ TailCallExternalReference(ref, 3, 1); | 809 __ TailCallExternalReference(ref, 3, 1); |
| 814 } | 810 } |
| 815 | 811 |
| 816 | 812 |
| 817 #undef __ | 813 #undef __ |
| 818 | 814 |
| 819 | 815 |
| 820 Condition CompareIC::ComputeCondition(Token::Value op) { | 816 Condition CompareIC::ComputeCondition(Token::Value op) { |
| 821 switch (op) { | 817 switch (op) { |
| 822 case Token::EQ_STRICT: | 818 case Token::EQ_STRICT: |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 881 Condition cc = | 877 Condition cc = |
| 882 (check == ENABLE_INLINED_SMI_CHECK) | 878 (check == ENABLE_INLINED_SMI_CHECK) |
| 883 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) | 879 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) |
| 884 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); | 880 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); |
| 885 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 881 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
| 886 } | 882 } |
| 887 } // namespace internal | 883 } // namespace internal |
| 888 } // namespace v8 | 884 } // namespace v8 |
| 889 | 885 |
| 890 #endif // V8_TARGET_ARCH_IA32 | 886 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |