| 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 | 5 |
| 6 #include "src/v8.h" | 6 #include "src/v8.h" |
| 7 | 7 |
| 8 #if V8_TARGET_ARCH_MIPS | 8 #if V8_TARGET_ARCH_MIPS |
| 9 | 9 |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 735 KeyedStoreGenerateMegamorphicHelper(masm, &fast_object_grow, | 735 KeyedStoreGenerateMegamorphicHelper(masm, &fast_object_grow, |
| 736 &fast_double_grow, &slow, kDontCheckMap, | 736 &fast_double_grow, &slow, kDontCheckMap, |
| 737 kIncrementLength, value, key, receiver, | 737 kIncrementLength, value, key, receiver, |
| 738 receiver_map, elements_map, elements); | 738 receiver_map, elements_map, elements); |
| 739 | 739 |
| 740 __ bind(&miss); | 740 __ bind(&miss); |
| 741 GenerateMiss(masm); | 741 GenerateMiss(masm); |
| 742 } | 742 } |
| 743 | 743 |
| 744 | 744 |
| 745 static void StoreIC_PushArgs(MacroAssembler* masm) { |
| 746 if (FLAG_vector_stores) { |
| 747 __ Push(StoreDescriptor::ReceiverRegister(), |
| 748 StoreDescriptor::NameRegister(), StoreDescriptor::ValueRegister(), |
| 749 VectorStoreICDescriptor::SlotRegister(), |
| 750 VectorStoreICDescriptor::VectorRegister()); |
| 751 } else { |
| 752 __ Push(StoreDescriptor::ReceiverRegister(), |
| 753 StoreDescriptor::NameRegister(), StoreDescriptor::ValueRegister()); |
| 754 } |
| 755 } |
| 756 |
| 757 |
| 745 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { | 758 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { |
| 746 // Push receiver, key and value for runtime call. | 759 StoreIC_PushArgs(masm); |
| 747 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), | |
| 748 StoreDescriptor::ValueRegister()); | |
| 749 | 760 |
| 750 __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss, 3, 1); | 761 int args = FLAG_vector_stores ? 5 : 3; |
| 762 __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss, args, 1); |
| 751 } | 763 } |
| 752 | 764 |
| 753 | 765 |
| 754 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { | 766 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { |
| 755 Register receiver = StoreDescriptor::ReceiverRegister(); | 767 Register receiver = StoreDescriptor::ReceiverRegister(); |
| 756 Register name = StoreDescriptor::NameRegister(); | 768 Register name = StoreDescriptor::NameRegister(); |
| 757 DCHECK(receiver.is(a1)); | 769 DCHECK(receiver.is(a1)); |
| 758 DCHECK(name.is(a2)); | 770 DCHECK(name.is(a2)); |
| 759 DCHECK(StoreDescriptor::ValueRegister().is(a0)); | 771 DCHECK(StoreDescriptor::ValueRegister().is(a0)); |
| 760 | 772 |
| 761 // Get the receiver from the stack and probe the stub cache. | 773 // Get the receiver from the stack and probe the stub cache. |
| 762 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 774 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
| 763 Code::ComputeHandlerFlags(Code::STORE_IC)); | 775 Code::ComputeHandlerFlags(Code::STORE_IC)); |
| 764 masm->isolate()->stub_cache()->GenerateProbe( | 776 masm->isolate()->stub_cache()->GenerateProbe( |
| 765 masm, Code::STORE_IC, flags, false, receiver, name, a3, t0, t1, t2); | 777 masm, Code::STORE_IC, flags, false, receiver, name, a3, t0, t1, t2); |
| 766 | 778 |
| 767 // Cache miss: Jump to runtime. | 779 // Cache miss: Jump to runtime. |
| 768 GenerateMiss(masm); | 780 GenerateMiss(masm); |
| 769 } | 781 } |
| 770 | 782 |
| 771 | 783 |
| 772 void StoreIC::GenerateMiss(MacroAssembler* masm) { | 784 void StoreIC::GenerateMiss(MacroAssembler* masm) { |
| 773 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), | 785 StoreIC_PushArgs(masm); |
| 774 StoreDescriptor::ValueRegister()); | 786 |
| 775 // Perform tail call to the entry. | 787 // Perform tail call to the entry. |
| 776 __ TailCallRuntime(Runtime::kStoreIC_Miss, 3, 1); | 788 int args = FLAG_vector_stores ? 5 : 3; |
| 789 __ TailCallRuntime(Runtime::kStoreIC_Miss, args, 1); |
| 777 } | 790 } |
| 778 | 791 |
| 779 | 792 |
| 780 void StoreIC::GenerateNormal(MacroAssembler* masm) { | 793 void StoreIC::GenerateNormal(MacroAssembler* masm) { |
| 781 Label miss; | 794 Label miss; |
| 782 Register receiver = StoreDescriptor::ReceiverRegister(); | 795 Register receiver = StoreDescriptor::ReceiverRegister(); |
| 783 Register name = StoreDescriptor::NameRegister(); | 796 Register name = StoreDescriptor::NameRegister(); |
| 784 Register value = StoreDescriptor::ValueRegister(); | 797 Register value = StoreDescriptor::ValueRegister(); |
| 785 Register dictionary = a3; | 798 Register dictionary = a3; |
| 786 DCHECK(receiver.is(a1)); | 799 DCHECK(receiver.is(a1)); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 892 patcher.ChangeBranchCondition(ne); | 905 patcher.ChangeBranchCondition(ne); |
| 893 } else { | 906 } else { |
| 894 DCHECK(Assembler::IsBne(branch_instr)); | 907 DCHECK(Assembler::IsBne(branch_instr)); |
| 895 patcher.ChangeBranchCondition(eq); | 908 patcher.ChangeBranchCondition(eq); |
| 896 } | 909 } |
| 897 } | 910 } |
| 898 } // namespace internal | 911 } // namespace internal |
| 899 } // namespace v8 | 912 } // namespace v8 |
| 900 | 913 |
| 901 #endif // V8_TARGET_ARCH_MIPS | 914 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |