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