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 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 DCHECK(!AreAliased(vector, slot, t0, t1, t2, t5)); | 435 DCHECK(!AreAliased(vector, slot, t0, t1, t2, t5)); |
436 Handle<TypeFeedbackVector> dummy_vector = | 436 Handle<TypeFeedbackVector> dummy_vector = |
437 TypeFeedbackVector::DummyVector(masm->isolate()); | 437 TypeFeedbackVector::DummyVector(masm->isolate()); |
438 int slot_index = dummy_vector->GetIndex( | 438 int slot_index = dummy_vector->GetIndex( |
439 FeedbackVectorICSlot(TypeFeedbackVector::kDummyKeyedLoadICSlot)); | 439 FeedbackVectorICSlot(TypeFeedbackVector::kDummyKeyedLoadICSlot)); |
440 __ LoadRoot(vector, Heap::kDummyVectorRootIndex); | 440 __ LoadRoot(vector, Heap::kDummyVectorRootIndex); |
441 __ li(slot, Operand(Smi::FromInt(slot_index))); | 441 __ li(slot, Operand(Smi::FromInt(slot_index))); |
442 | 442 |
443 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 443 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
444 Code::ComputeHandlerFlags(Code::LOAD_IC)); | 444 Code::ComputeHandlerFlags(Code::LOAD_IC)); |
445 masm->isolate()->stub_cache()->GenerateProbe( | 445 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::LOAD_IC, flags, |
446 masm, Code::LOAD_IC, flags, false, receiver, key, t0, t1, t2, t5); | 446 receiver, key, t0, t1, t2, t5); |
447 // Cache miss. | 447 // Cache miss. |
448 GenerateMiss(masm); | 448 GenerateMiss(masm); |
449 | 449 |
450 // Do a quick inline probe of the receiver's dictionary, if it | 450 // Do a quick inline probe of the receiver's dictionary, if it |
451 // exists. | 451 // exists. |
452 __ bind(&probe_dictionary); | 452 __ bind(&probe_dictionary); |
453 // a3: elements | 453 // a3: elements |
454 __ lw(a0, FieldMemOperand(receiver, HeapObject::kMapOffset)); | 454 __ lw(a0, FieldMemOperand(receiver, HeapObject::kMapOffset)); |
455 __ lbu(a0, FieldMemOperand(a0, Map::kInstanceTypeOffset)); | 455 __ lbu(a0, FieldMemOperand(a0, Map::kInstanceTypeOffset)); |
456 GenerateGlobalInstanceTypeCheck(masm, a0, &slow); | 456 GenerateGlobalInstanceTypeCheck(masm, a0, &slow); |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 Handle<TypeFeedbackVector> dummy_vector = | 685 Handle<TypeFeedbackVector> dummy_vector = |
686 TypeFeedbackVector::DummyVector(masm->isolate()); | 686 TypeFeedbackVector::DummyVector(masm->isolate()); |
687 int slot_index = dummy_vector->GetIndex( | 687 int slot_index = dummy_vector->GetIndex( |
688 FeedbackVectorICSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot)); | 688 FeedbackVectorICSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot)); |
689 __ LoadRoot(vector, Heap::kDummyVectorRootIndex); | 689 __ LoadRoot(vector, Heap::kDummyVectorRootIndex); |
690 __ li(slot, Operand(Smi::FromInt(slot_index))); | 690 __ li(slot, Operand(Smi::FromInt(slot_index))); |
691 } | 691 } |
692 | 692 |
693 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 693 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
694 Code::ComputeHandlerFlags(Code::STORE_IC)); | 694 Code::ComputeHandlerFlags(Code::STORE_IC)); |
695 masm->isolate()->stub_cache()->GenerateProbe( | 695 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::STORE_IC, flags, |
696 masm, Code::STORE_IC, flags, false, receiver, key, a3, t0, t1, t2); | 696 receiver, key, a3, t0, t1, t2); |
697 // Cache miss. | 697 // Cache miss. |
698 __ Branch(&miss); | 698 __ Branch(&miss); |
699 | 699 |
700 // Extra capacity case: Check if there is extra capacity to | 700 // Extra capacity case: Check if there is extra capacity to |
701 // perform the store and update the length. Used for adding one | 701 // perform the store and update the length. Used for adding one |
702 // element to the array by writing to array[array.length]. | 702 // element to the array by writing to array[array.length]. |
703 __ bind(&extra); | 703 __ bind(&extra); |
704 // Condition code from comparing key and array length is still available. | 704 // Condition code from comparing key and array length is still available. |
705 // Only support writing to array[array.length]. | 705 // Only support writing to array[array.length]. |
706 __ Branch(&slow, ne, key, Operand(t0)); | 706 __ Branch(&slow, ne, key, Operand(t0)); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
765 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { | 765 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { |
766 Register receiver = StoreDescriptor::ReceiverRegister(); | 766 Register receiver = StoreDescriptor::ReceiverRegister(); |
767 Register name = StoreDescriptor::NameRegister(); | 767 Register name = StoreDescriptor::NameRegister(); |
768 DCHECK(receiver.is(a1)); | 768 DCHECK(receiver.is(a1)); |
769 DCHECK(name.is(a2)); | 769 DCHECK(name.is(a2)); |
770 DCHECK(StoreDescriptor::ValueRegister().is(a0)); | 770 DCHECK(StoreDescriptor::ValueRegister().is(a0)); |
771 | 771 |
772 // Get the receiver from the stack and probe the stub cache. | 772 // Get the receiver from the stack and probe the stub cache. |
773 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 773 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
774 Code::ComputeHandlerFlags(Code::STORE_IC)); | 774 Code::ComputeHandlerFlags(Code::STORE_IC)); |
775 masm->isolate()->stub_cache()->GenerateProbe( | 775 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::STORE_IC, flags, |
776 masm, Code::STORE_IC, flags, false, receiver, name, a3, t0, t1, t2); | 776 receiver, name, a3, t0, t1, t2); |
777 | 777 |
778 // Cache miss: Jump to runtime. | 778 // Cache miss: Jump to runtime. |
779 GenerateMiss(masm); | 779 GenerateMiss(masm); |
780 } | 780 } |
781 | 781 |
782 | 782 |
783 void StoreIC::GenerateMiss(MacroAssembler* masm) { | 783 void StoreIC::GenerateMiss(MacroAssembler* masm) { |
784 StoreIC_PushArgs(masm); | 784 StoreIC_PushArgs(masm); |
785 | 785 |
786 // Perform tail call to the entry. | 786 // Perform tail call to the entry. |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
904 patcher.ChangeBranchCondition(ne); | 904 patcher.ChangeBranchCondition(ne); |
905 } else { | 905 } else { |
906 DCHECK(Assembler::IsBne(branch_instr)); | 906 DCHECK(Assembler::IsBne(branch_instr)); |
907 patcher.ChangeBranchCondition(eq); | 907 patcher.ChangeBranchCondition(eq); |
908 } | 908 } |
909 } | 909 } |
910 } // namespace internal | 910 } // namespace internal |
911 } // namespace v8 | 911 } // namespace v8 |
912 | 912 |
913 #endif // V8_TARGET_ARCH_MIPS | 913 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |