| 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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 Register vector = LoadWithVectorDescriptor::VectorRegister(); | 412 Register vector = LoadWithVectorDescriptor::VectorRegister(); |
| 413 Register slot = LoadWithVectorDescriptor::SlotRegister(); | 413 Register slot = LoadWithVectorDescriptor::SlotRegister(); |
| 414 DCHECK(!AreAliased(vector, slot, t0, t1, t2, t5)); | 414 DCHECK(!AreAliased(vector, slot, t0, t1, t2, t5)); |
| 415 Handle<TypeFeedbackVector> dummy_vector = | 415 Handle<TypeFeedbackVector> dummy_vector = |
| 416 TypeFeedbackVector::DummyVector(masm->isolate()); | 416 TypeFeedbackVector::DummyVector(masm->isolate()); |
| 417 int slot_index = dummy_vector->GetIndex( | 417 int slot_index = dummy_vector->GetIndex( |
| 418 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedLoadICSlot)); | 418 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedLoadICSlot)); |
| 419 __ LoadRoot(vector, Heap::kDummyVectorRootIndex); | 419 __ LoadRoot(vector, Heap::kDummyVectorRootIndex); |
| 420 __ li(slot, Operand(Smi::FromInt(slot_index))); | 420 __ li(slot, Operand(Smi::FromInt(slot_index))); |
| 421 | 421 |
| 422 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 422 Code::Flags flags = |
| 423 Code::ComputeHandlerFlags(Code::LOAD_IC)); | 423 Code::RemoveHolderFromFlags(Code::ComputeHandlerFlags(Code::LOAD_IC)); |
| 424 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::LOAD_IC, flags, | 424 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::LOAD_IC, flags, |
| 425 receiver, key, t0, t1, t2, t5); | 425 receiver, key, t0, t1, t2, t5); |
| 426 // Cache miss. | 426 // Cache miss. |
| 427 GenerateMiss(masm); | 427 GenerateMiss(masm); |
| 428 | 428 |
| 429 // Do a quick inline probe of the receiver's dictionary, if it | 429 // Do a quick inline probe of the receiver's dictionary, if it |
| 430 // exists. | 430 // exists. |
| 431 __ bind(&probe_dictionary); | 431 __ bind(&probe_dictionary); |
| 432 // a3: elements | 432 // a3: elements |
| 433 __ lw(a0, FieldMemOperand(receiver, HeapObject::kMapOffset)); | 433 __ lw(a0, FieldMemOperand(receiver, HeapObject::kMapOffset)); |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 Register vector = VectorStoreICDescriptor::VectorRegister(); | 656 Register vector = VectorStoreICDescriptor::VectorRegister(); |
| 657 Register slot = VectorStoreICDescriptor::SlotRegister(); | 657 Register slot = VectorStoreICDescriptor::SlotRegister(); |
| 658 DCHECK(!AreAliased(vector, slot, t1, t2, t4, t5)); | 658 DCHECK(!AreAliased(vector, slot, t1, t2, t4, t5)); |
| 659 Handle<TypeFeedbackVector> dummy_vector = | 659 Handle<TypeFeedbackVector> dummy_vector = |
| 660 TypeFeedbackVector::DummyVector(masm->isolate()); | 660 TypeFeedbackVector::DummyVector(masm->isolate()); |
| 661 int slot_index = dummy_vector->GetIndex( | 661 int slot_index = dummy_vector->GetIndex( |
| 662 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot)); | 662 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot)); |
| 663 __ LoadRoot(vector, Heap::kDummyVectorRootIndex); | 663 __ LoadRoot(vector, Heap::kDummyVectorRootIndex); |
| 664 __ li(slot, Operand(Smi::FromInt(slot_index))); | 664 __ li(slot, Operand(Smi::FromInt(slot_index))); |
| 665 | 665 |
| 666 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 666 Code::Flags flags = |
| 667 Code::ComputeHandlerFlags(Code::STORE_IC)); | 667 Code::RemoveHolderFromFlags(Code::ComputeHandlerFlags(Code::STORE_IC)); |
| 668 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::STORE_IC, flags, | 668 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::STORE_IC, flags, |
| 669 receiver, key, t1, t2, t4, t5); | 669 receiver, key, t1, t2, t4, t5); |
| 670 // Cache miss. | 670 // Cache miss. |
| 671 __ Branch(&miss); | 671 __ Branch(&miss); |
| 672 | 672 |
| 673 // Extra capacity case: Check if there is extra capacity to | 673 // Extra capacity case: Check if there is extra capacity to |
| 674 // perform the store and update the length. Used for adding one | 674 // perform the store and update the length. Used for adding one |
| 675 // element to the array by writing to array[array.length]. | 675 // element to the array by writing to array[array.length]. |
| 676 __ bind(&extra); | 676 __ bind(&extra); |
| 677 // Condition code from comparing key and array length is still available. | 677 // Condition code from comparing key and array length is still available. |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 730 | 730 |
| 731 | 731 |
| 732 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { | 732 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { |
| 733 Register receiver = StoreDescriptor::ReceiverRegister(); | 733 Register receiver = StoreDescriptor::ReceiverRegister(); |
| 734 Register name = StoreDescriptor::NameRegister(); | 734 Register name = StoreDescriptor::NameRegister(); |
| 735 DCHECK(receiver.is(a1)); | 735 DCHECK(receiver.is(a1)); |
| 736 DCHECK(name.is(a2)); | 736 DCHECK(name.is(a2)); |
| 737 DCHECK(StoreDescriptor::ValueRegister().is(a0)); | 737 DCHECK(StoreDescriptor::ValueRegister().is(a0)); |
| 738 | 738 |
| 739 // Get the receiver from the stack and probe the stub cache. | 739 // Get the receiver from the stack and probe the stub cache. |
| 740 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 740 Code::Flags flags = |
| 741 Code::ComputeHandlerFlags(Code::STORE_IC)); | 741 Code::RemoveHolderFromFlags(Code::ComputeHandlerFlags(Code::STORE_IC)); |
| 742 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::STORE_IC, flags, | 742 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::STORE_IC, flags, |
| 743 receiver, name, a3, t0, t1, t2); | 743 receiver, name, a3, t0, t1, t2); |
| 744 | 744 |
| 745 // Cache miss: Jump to runtime. | 745 // Cache miss: Jump to runtime. |
| 746 GenerateMiss(masm); | 746 GenerateMiss(masm); |
| 747 } | 747 } |
| 748 | 748 |
| 749 | 749 |
| 750 void StoreIC::GenerateMiss(MacroAssembler* masm) { | 750 void StoreIC::GenerateMiss(MacroAssembler* masm) { |
| 751 StoreIC_PushArgs(masm); | 751 StoreIC_PushArgs(masm); |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 902 break; | 902 break; |
| 903 default: | 903 default: |
| 904 UNIMPLEMENTED(); | 904 UNIMPLEMENTED(); |
| 905 } | 905 } |
| 906 patcher.ChangeBranchCondition(branch_instr, opcode); | 906 patcher.ChangeBranchCondition(branch_instr, opcode); |
| 907 } | 907 } |
| 908 } // namespace internal | 908 } // namespace internal |
| 909 } // namespace v8 | 909 } // namespace v8 |
| 910 | 910 |
| 911 #endif // V8_TARGET_ARCH_MIPS | 911 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |