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