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