| 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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
| 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 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 // The return address is on the stack. | 306 // The return address is on the stack. |
| 307 Isolate* isolate = masm->isolate(); | 307 Isolate* isolate = masm->isolate(); |
| 308 | 308 |
| 309 DCHECK(!AreAliased(a4, a5, LoadWithVectorDescriptor::SlotRegister(), | 309 DCHECK(!AreAliased(a4, a5, LoadWithVectorDescriptor::SlotRegister(), |
| 310 LoadWithVectorDescriptor::VectorRegister())); | 310 LoadWithVectorDescriptor::VectorRegister())); |
| 311 __ IncrementCounter(isolate->counters()->load_miss(), 1, a4, a5); | 311 __ IncrementCounter(isolate->counters()->load_miss(), 1, a4, a5); |
| 312 | 312 |
| 313 LoadIC_PushArgs(masm); | 313 LoadIC_PushArgs(masm); |
| 314 | 314 |
| 315 // Perform tail call to the entry. | 315 // Perform tail call to the entry. |
| 316 int arg_count = 4; | 316 __ TailCallRuntime(Runtime::kLoadIC_Miss); |
| 317 __ TailCallRuntime(Runtime::kLoadIC_Miss, arg_count); | |
| 318 } | 317 } |
| 319 | 318 |
| 320 | 319 |
| 321 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, | 320 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, |
| 322 LanguageMode language_mode) { | 321 LanguageMode language_mode) { |
| 323 // The return address is in ra. | 322 // The return address is in ra. |
| 324 | 323 |
| 325 __ mov(LoadIC_TempRegister(), LoadDescriptor::ReceiverRegister()); | 324 __ mov(LoadIC_TempRegister(), LoadDescriptor::ReceiverRegister()); |
| 326 __ Push(LoadIC_TempRegister(), LoadDescriptor::NameRegister()); | 325 __ Push(LoadIC_TempRegister(), LoadDescriptor::NameRegister()); |
| 327 | 326 |
| 328 // Do tail-call to runtime routine. | 327 // Do tail-call to runtime routine. |
| 329 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kGetPropertyStrong | 328 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kGetPropertyStrong |
| 330 : Runtime::kGetProperty, | 329 : Runtime::kGetProperty); |
| 331 2); | |
| 332 } | 330 } |
| 333 | 331 |
| 334 | 332 |
| 335 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { | 333 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { |
| 336 // The return address is in ra. | 334 // The return address is in ra. |
| 337 Isolate* isolate = masm->isolate(); | 335 Isolate* isolate = masm->isolate(); |
| 338 | 336 |
| 339 DCHECK(!AreAliased(a4, a5, LoadWithVectorDescriptor::SlotRegister(), | 337 DCHECK(!AreAliased(a4, a5, LoadWithVectorDescriptor::SlotRegister(), |
| 340 LoadWithVectorDescriptor::VectorRegister())); | 338 LoadWithVectorDescriptor::VectorRegister())); |
| 341 __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, a4, a5); | 339 __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, a4, a5); |
| 342 | 340 |
| 343 LoadIC_PushArgs(masm); | 341 LoadIC_PushArgs(masm); |
| 344 | 342 |
| 345 // Perform tail call to the entry. | 343 // Perform tail call to the entry. |
| 346 int arg_count = 4; | 344 __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss); |
| 347 __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss, arg_count); | |
| 348 } | 345 } |
| 349 | 346 |
| 350 | 347 |
| 351 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, | 348 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, |
| 352 LanguageMode language_mode) { | 349 LanguageMode language_mode) { |
| 353 // The return address is in ra. | 350 // The return address is in ra. |
| 354 | 351 |
| 355 __ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister()); | 352 __ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister()); |
| 356 | 353 |
| 357 // Do tail-call to runtime routine. | 354 // Do tail-call to runtime routine. |
| 358 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kKeyedGetPropertyStrong | 355 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kKeyedGetPropertyStrong |
| 359 : Runtime::kKeyedGetProperty, | 356 : Runtime::kKeyedGetProperty); |
| 360 2); | |
| 361 } | 357 } |
| 362 | 358 |
| 363 | 359 |
| 364 void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm, | 360 void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm, |
| 365 LanguageMode language_mode) { | 361 LanguageMode language_mode) { |
| 366 // The return address is in ra. | 362 // The return address is in ra. |
| 367 Label slow, check_name, index_smi, index_name, property_array_property; | 363 Label slow, check_name, index_smi, index_name, property_array_property; |
| 368 Label probe_dictionary, check_number_dictionary; | 364 Label probe_dictionary, check_number_dictionary; |
| 369 | 365 |
| 370 Register key = LoadDescriptor::NameRegister(); | 366 Register key = LoadDescriptor::NameRegister(); |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 740 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), | 736 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), |
| 741 StoreDescriptor::ValueRegister(), | 737 StoreDescriptor::ValueRegister(), |
| 742 VectorStoreICDescriptor::SlotRegister(), | 738 VectorStoreICDescriptor::SlotRegister(), |
| 743 VectorStoreICDescriptor::VectorRegister()); | 739 VectorStoreICDescriptor::VectorRegister()); |
| 744 } | 740 } |
| 745 | 741 |
| 746 | 742 |
| 747 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { | 743 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { |
| 748 StoreIC_PushArgs(masm); | 744 StoreIC_PushArgs(masm); |
| 749 | 745 |
| 750 __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss, 5); | 746 __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss); |
| 751 } | 747 } |
| 752 | 748 |
| 753 | 749 |
| 754 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { | 750 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { |
| 755 Register receiver = StoreDescriptor::ReceiverRegister(); | 751 Register receiver = StoreDescriptor::ReceiverRegister(); |
| 756 Register name = StoreDescriptor::NameRegister(); | 752 Register name = StoreDescriptor::NameRegister(); |
| 757 DCHECK(receiver.is(a1)); | 753 DCHECK(receiver.is(a1)); |
| 758 DCHECK(name.is(a2)); | 754 DCHECK(name.is(a2)); |
| 759 DCHECK(StoreDescriptor::ValueRegister().is(a0)); | 755 DCHECK(StoreDescriptor::ValueRegister().is(a0)); |
| 760 | 756 |
| 761 // Get the receiver from the stack and probe the stub cache. | 757 // Get the receiver from the stack and probe the stub cache. |
| 762 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 758 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
| 763 Code::ComputeHandlerFlags(Code::STORE_IC)); | 759 Code::ComputeHandlerFlags(Code::STORE_IC)); |
| 764 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::STORE_IC, flags, | 760 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::STORE_IC, flags, |
| 765 receiver, name, a3, a4, a5, a6); | 761 receiver, name, a3, a4, a5, a6); |
| 766 | 762 |
| 767 // Cache miss: Jump to runtime. | 763 // Cache miss: Jump to runtime. |
| 768 GenerateMiss(masm); | 764 GenerateMiss(masm); |
| 769 } | 765 } |
| 770 | 766 |
| 771 | 767 |
| 772 void StoreIC::GenerateMiss(MacroAssembler* masm) { | 768 void StoreIC::GenerateMiss(MacroAssembler* masm) { |
| 773 StoreIC_PushArgs(masm); | 769 StoreIC_PushArgs(masm); |
| 774 | 770 |
| 775 // Perform tail call to the entry. | 771 // Perform tail call to the entry. |
| 776 __ TailCallRuntime(Runtime::kStoreIC_Miss, 5); | 772 __ TailCallRuntime(Runtime::kStoreIC_Miss); |
| 777 } | 773 } |
| 778 | 774 |
| 779 | 775 |
| 780 void StoreIC::GenerateNormal(MacroAssembler* masm) { | 776 void StoreIC::GenerateNormal(MacroAssembler* masm) { |
| 781 Label miss; | 777 Label miss; |
| 782 Register receiver = StoreDescriptor::ReceiverRegister(); | 778 Register receiver = StoreDescriptor::ReceiverRegister(); |
| 783 Register name = StoreDescriptor::NameRegister(); | 779 Register name = StoreDescriptor::NameRegister(); |
| 784 Register value = StoreDescriptor::ValueRegister(); | 780 Register value = StoreDescriptor::ValueRegister(); |
| 785 Register dictionary = a5; | 781 Register dictionary = a5; |
| 786 DCHECK(!AreAliased( | 782 DCHECK(!AreAliased( |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 893 patcher.ChangeBranchCondition(ne); | 889 patcher.ChangeBranchCondition(ne); |
| 894 } else { | 890 } else { |
| 895 DCHECK(Assembler::IsBne(branch_instr)); | 891 DCHECK(Assembler::IsBne(branch_instr)); |
| 896 patcher.ChangeBranchCondition(eq); | 892 patcher.ChangeBranchCondition(eq); |
| 897 } | 893 } |
| 898 } | 894 } |
| 899 } // namespace internal | 895 } // namespace internal |
| 900 } // namespace v8 | 896 } // namespace v8 |
| 901 | 897 |
| 902 #endif // V8_TARGET_ARCH_MIPS64 | 898 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |