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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 // The return address is in ra. | 313 // The return address is in ra. |
314 Isolate* isolate = masm->isolate(); | 314 Isolate* isolate = masm->isolate(); |
315 | 315 |
316 DCHECK(!AreAliased(t0, t1, LoadWithVectorDescriptor::SlotRegister(), | 316 DCHECK(!AreAliased(t0, t1, LoadWithVectorDescriptor::SlotRegister(), |
317 LoadWithVectorDescriptor::VectorRegister())); | 317 LoadWithVectorDescriptor::VectorRegister())); |
318 __ IncrementCounter(isolate->counters()->load_miss(), 1, t0, t1); | 318 __ IncrementCounter(isolate->counters()->load_miss(), 1, t0, t1); |
319 | 319 |
320 LoadIC_PushArgs(masm); | 320 LoadIC_PushArgs(masm); |
321 | 321 |
322 // Perform tail call to the entry. | 322 // Perform tail call to the entry. |
323 ExternalReference ref = ExternalReference(IC_Utility(kLoadIC_Miss), isolate); | 323 ExternalReference ref = |
| 324 ExternalReference(Runtime::FunctionForId(Runtime::kLoadIC_Miss), isolate); |
324 int arg_count = 4; | 325 int arg_count = 4; |
325 __ TailCallExternalReference(ref, arg_count, 1); | 326 __ TailCallExternalReference(ref, arg_count, 1); |
326 } | 327 } |
327 | 328 |
328 | 329 |
329 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, | 330 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, |
330 LanguageMode language_mode) { | 331 LanguageMode language_mode) { |
331 // The return address is in ra. | 332 // The return address is in ra. |
332 | 333 |
333 __ mov(LoadIC_TempRegister(), LoadDescriptor::ReceiverRegister()); | 334 __ mov(LoadIC_TempRegister(), LoadDescriptor::ReceiverRegister()); |
(...skipping 10 matching lines...) Expand all Loading... |
344 // The return address is in ra. | 345 // The return address is in ra. |
345 Isolate* isolate = masm->isolate(); | 346 Isolate* isolate = masm->isolate(); |
346 | 347 |
347 DCHECK(!AreAliased(t0, t1, LoadWithVectorDescriptor::SlotRegister(), | 348 DCHECK(!AreAliased(t0, t1, LoadWithVectorDescriptor::SlotRegister(), |
348 LoadWithVectorDescriptor::VectorRegister())); | 349 LoadWithVectorDescriptor::VectorRegister())); |
349 __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, t0, t1); | 350 __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, t0, t1); |
350 | 351 |
351 LoadIC_PushArgs(masm); | 352 LoadIC_PushArgs(masm); |
352 | 353 |
353 // Perform tail call to the entry. | 354 // Perform tail call to the entry. |
354 ExternalReference ref = | 355 ExternalReference ref = ExternalReference( |
355 ExternalReference(IC_Utility(kKeyedLoadIC_Miss), isolate); | 356 Runtime::FunctionForId(Runtime::kKeyedLoadIC_Miss), isolate); |
356 | 357 |
357 int arg_count = 4; | 358 int arg_count = 4; |
358 __ TailCallExternalReference(ref, arg_count, 1); | 359 __ TailCallExternalReference(ref, arg_count, 1); |
359 } | 360 } |
360 | 361 |
361 | 362 |
362 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, | 363 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, |
363 LanguageMode language_mode) { | 364 LanguageMode language_mode) { |
364 // The return address is in ra. | 365 // The return address is in ra. |
365 | 366 |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
744 __ bind(&miss); | 745 __ bind(&miss); |
745 GenerateMiss(masm); | 746 GenerateMiss(masm); |
746 } | 747 } |
747 | 748 |
748 | 749 |
749 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { | 750 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { |
750 // Push receiver, key and value for runtime call. | 751 // Push receiver, key and value for runtime call. |
751 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), | 752 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), |
752 StoreDescriptor::ValueRegister()); | 753 StoreDescriptor::ValueRegister()); |
753 | 754 |
754 ExternalReference ref = | 755 ExternalReference ref = ExternalReference( |
755 ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate()); | 756 Runtime::FunctionForId(Runtime::kKeyedStoreIC_Miss), masm->isolate()); |
756 __ TailCallExternalReference(ref, 3, 1); | 757 __ TailCallExternalReference(ref, 3, 1); |
757 } | 758 } |
758 | 759 |
759 | 760 |
760 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { | 761 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { |
761 Register receiver = StoreDescriptor::ReceiverRegister(); | 762 Register receiver = StoreDescriptor::ReceiverRegister(); |
762 Register name = StoreDescriptor::NameRegister(); | 763 Register name = StoreDescriptor::NameRegister(); |
763 DCHECK(receiver.is(a1)); | 764 DCHECK(receiver.is(a1)); |
764 DCHECK(name.is(a2)); | 765 DCHECK(name.is(a2)); |
765 DCHECK(StoreDescriptor::ValueRegister().is(a0)); | 766 DCHECK(StoreDescriptor::ValueRegister().is(a0)); |
766 | 767 |
767 // Get the receiver from the stack and probe the stub cache. | 768 // Get the receiver from the stack and probe the stub cache. |
768 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 769 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
769 Code::ComputeHandlerFlags(Code::STORE_IC)); | 770 Code::ComputeHandlerFlags(Code::STORE_IC)); |
770 masm->isolate()->stub_cache()->GenerateProbe( | 771 masm->isolate()->stub_cache()->GenerateProbe( |
771 masm, Code::STORE_IC, flags, false, receiver, name, a3, t0, t1, t2); | 772 masm, Code::STORE_IC, flags, false, receiver, name, a3, t0, t1, t2); |
772 | 773 |
773 // Cache miss: Jump to runtime. | 774 // Cache miss: Jump to runtime. |
774 GenerateMiss(masm); | 775 GenerateMiss(masm); |
775 } | 776 } |
776 | 777 |
777 | 778 |
778 void StoreIC::GenerateMiss(MacroAssembler* masm) { | 779 void StoreIC::GenerateMiss(MacroAssembler* masm) { |
779 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), | 780 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), |
780 StoreDescriptor::ValueRegister()); | 781 StoreDescriptor::ValueRegister()); |
781 // Perform tail call to the entry. | 782 // Perform tail call to the entry. |
782 ExternalReference ref = | 783 ExternalReference ref = ExternalReference( |
783 ExternalReference(IC_Utility(kStoreIC_Miss), masm->isolate()); | 784 Runtime::FunctionForId(Runtime::kStoreIC_Miss), masm->isolate()); |
784 __ TailCallExternalReference(ref, 3, 1); | 785 __ TailCallExternalReference(ref, 3, 1); |
785 } | 786 } |
786 | 787 |
787 | 788 |
788 void StoreIC::GenerateNormal(MacroAssembler* masm) { | 789 void StoreIC::GenerateNormal(MacroAssembler* masm) { |
789 Label miss; | 790 Label miss; |
790 Register receiver = StoreDescriptor::ReceiverRegister(); | 791 Register receiver = StoreDescriptor::ReceiverRegister(); |
791 Register name = StoreDescriptor::NameRegister(); | 792 Register name = StoreDescriptor::NameRegister(); |
792 Register value = StoreDescriptor::ValueRegister(); | 793 Register value = StoreDescriptor::ValueRegister(); |
793 Register dictionary = a3; | 794 Register dictionary = a3; |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
900 patcher.ChangeBranchCondition(ne); | 901 patcher.ChangeBranchCondition(ne); |
901 } else { | 902 } else { |
902 DCHECK(Assembler::IsBne(branch_instr)); | 903 DCHECK(Assembler::IsBne(branch_instr)); |
903 patcher.ChangeBranchCondition(eq); | 904 patcher.ChangeBranchCondition(eq); |
904 } | 905 } |
905 } | 906 } |
906 } // namespace internal | 907 } // namespace internal |
907 } // namespace v8 | 908 } // namespace v8 |
908 | 909 |
909 #endif // V8_TARGET_ARCH_MIPS | 910 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |