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