| 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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
| 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 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 TypeFeedbackVector::DummyVector(masm->isolate()); | 570 TypeFeedbackVector::DummyVector(masm->isolate()); |
| 571 int slot = dummy_vector->GetIndex( | 571 int slot = dummy_vector->GetIndex( |
| 572 FeedbackVectorICSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot)); | 572 FeedbackVectorICSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot)); |
| 573 __ push(Immediate(Smi::FromInt(slot))); | 573 __ push(Immediate(Smi::FromInt(slot))); |
| 574 __ push(Immediate(dummy_vector)); | 574 __ push(Immediate(dummy_vector)); |
| 575 } | 575 } |
| 576 | 576 |
| 577 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 577 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
| 578 Code::ComputeHandlerFlags(Code::STORE_IC)); | 578 Code::ComputeHandlerFlags(Code::STORE_IC)); |
| 579 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::STORE_IC, flags, | 579 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::STORE_IC, flags, |
| 580 receiver, key, ebx, no_reg); | 580 receiver, key, edi, no_reg); |
| 581 | 581 |
| 582 if (FLAG_vector_stores) { | 582 if (FLAG_vector_stores) { |
| 583 __ pop(VectorStoreICDescriptor::VectorRegister()); | 583 __ pop(VectorStoreICDescriptor::VectorRegister()); |
| 584 __ pop(VectorStoreICDescriptor::SlotRegister()); | 584 __ pop(VectorStoreICDescriptor::SlotRegister()); |
| 585 } | 585 } |
| 586 | 586 |
| 587 // Cache miss. | 587 // Cache miss. |
| 588 __ jmp(&miss); | 588 __ jmp(&miss); |
| 589 | 589 |
| 590 // Extra capacity case: Check if there is extra capacity to | 590 // Extra capacity case: Check if there is extra capacity to |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 __ push(ebx); | 727 __ push(ebx); |
| 728 | 728 |
| 729 // Do tail-call to runtime routine. | 729 // Do tail-call to runtime routine. |
| 730 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kKeyedGetPropertyStrong | 730 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kKeyedGetPropertyStrong |
| 731 : Runtime::kKeyedGetProperty, | 731 : Runtime::kKeyedGetProperty, |
| 732 2, 1); | 732 2, 1); |
| 733 } | 733 } |
| 734 | 734 |
| 735 | 735 |
| 736 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { | 736 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { |
| 737 if (FLAG_vector_stores) { |
| 738 // This shouldn't be called. |
| 739 __ int3(); |
| 740 return; |
| 741 } |
| 742 |
| 737 // Return address is on the stack. | 743 // Return address is on the stack. |
| 738 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 744 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
| 739 Code::ComputeHandlerFlags(Code::STORE_IC)); | 745 Code::ComputeHandlerFlags(Code::STORE_IC)); |
| 740 masm->isolate()->stub_cache()->GenerateProbe( | 746 masm->isolate()->stub_cache()->GenerateProbe( |
| 741 masm, Code::STORE_IC, flags, StoreDescriptor::ReceiverRegister(), | 747 masm, Code::STORE_IC, flags, StoreDescriptor::ReceiverRegister(), |
| 742 StoreDescriptor::NameRegister(), ebx, no_reg); | 748 StoreDescriptor::NameRegister(), ebx, no_reg); |
| 743 | 749 |
| 744 // Cache miss: Jump to runtime. | 750 // Cache miss: Jump to runtime. |
| 745 GenerateMiss(masm); | 751 GenerateMiss(masm); |
| 746 } | 752 } |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 780 int args = FLAG_vector_stores ? 5 : 3; | 786 int args = FLAG_vector_stores ? 5 : 3; |
| 781 __ TailCallRuntime(Runtime::kStoreIC_Miss, args, 1); | 787 __ TailCallRuntime(Runtime::kStoreIC_Miss, args, 1); |
| 782 } | 788 } |
| 783 | 789 |
| 784 | 790 |
| 785 void StoreIC::GenerateNormal(MacroAssembler* masm) { | 791 void StoreIC::GenerateNormal(MacroAssembler* masm) { |
| 786 Label restore_miss; | 792 Label restore_miss; |
| 787 Register receiver = StoreDescriptor::ReceiverRegister(); | 793 Register receiver = StoreDescriptor::ReceiverRegister(); |
| 788 Register name = StoreDescriptor::NameRegister(); | 794 Register name = StoreDescriptor::NameRegister(); |
| 789 Register value = StoreDescriptor::ValueRegister(); | 795 Register value = StoreDescriptor::ValueRegister(); |
| 790 Register dictionary = ebx; | 796 Register vector = VectorStoreICDescriptor::VectorRegister(); |
| 791 | 797 Register slot = VectorStoreICDescriptor::SlotRegister(); |
| 792 __ mov(dictionary, FieldOperand(receiver, JSObject::kPropertiesOffset)); | |
| 793 | 798 |
| 794 // A lot of registers are needed for storing to slow case | 799 // A lot of registers are needed for storing to slow case |
| 795 // objects. Push and restore receiver but rely on | 800 // objects. Push and restore receiver but rely on |
| 796 // GenerateDictionaryStore preserving the value and name. | 801 // GenerateDictionaryStore preserving the value and name. |
| 797 __ push(receiver); | 802 __ push(receiver); |
| 803 if (FLAG_vector_stores) { |
| 804 __ push(vector); |
| 805 __ push(slot); |
| 806 } |
| 807 |
| 808 Register dictionary = ebx; |
| 809 __ mov(dictionary, FieldOperand(receiver, JSObject::kPropertiesOffset)); |
| 798 GenerateDictionaryStore(masm, &restore_miss, dictionary, name, value, | 810 GenerateDictionaryStore(masm, &restore_miss, dictionary, name, value, |
| 799 receiver, edi); | 811 receiver, edi); |
| 800 __ Drop(1); | 812 __ Drop(FLAG_vector_stores ? 3 : 1); |
| 801 Counters* counters = masm->isolate()->counters(); | 813 Counters* counters = masm->isolate()->counters(); |
| 802 __ IncrementCounter(counters->store_normal_hit(), 1); | 814 __ IncrementCounter(counters->store_normal_hit(), 1); |
| 803 __ ret(0); | 815 __ ret(0); |
| 804 | 816 |
| 805 __ bind(&restore_miss); | 817 __ bind(&restore_miss); |
| 818 if (FLAG_vector_stores) { |
| 819 __ pop(slot); |
| 820 __ pop(vector); |
| 821 } |
| 806 __ pop(receiver); | 822 __ pop(receiver); |
| 807 __ IncrementCounter(counters->store_normal_miss(), 1); | 823 __ IncrementCounter(counters->store_normal_miss(), 1); |
| 808 GenerateMiss(masm); | 824 GenerateMiss(masm); |
| 809 } | 825 } |
| 810 | 826 |
| 811 | 827 |
| 812 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { | 828 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { |
| 813 // Return address is on the stack. | 829 // Return address is on the stack. |
| 814 StoreIC_PushArgs(masm); | 830 StoreIC_PushArgs(masm); |
| 815 | 831 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 886 Condition cc = | 902 Condition cc = |
| 887 (check == ENABLE_INLINED_SMI_CHECK) | 903 (check == ENABLE_INLINED_SMI_CHECK) |
| 888 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) | 904 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) |
| 889 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); | 905 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); |
| 890 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 906 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
| 891 } | 907 } |
| 892 } // namespace internal | 908 } // namespace internal |
| 893 } // namespace v8 | 909 } // namespace v8 |
| 894 | 910 |
| 895 #endif // V8_TARGET_ARCH_IA32 | 911 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |