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