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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 = | 422 Code::Flags flags = |
423 Code::RemoveHolderFromFlags(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::KEYED_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)); |
434 __ lbu(a0, FieldMemOperand(a0, Map::kInstanceTypeOffset)); | 434 __ lbu(a0, FieldMemOperand(a0, Map::kInstanceTypeOffset)); |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 = | 666 Code::Flags flags = |
667 Code::RemoveHolderFromFlags(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( |
669 receiver, key, t1, t2, t4, t5); | 669 masm, Code::KEYED_STORE_IC, flags, 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. |
678 // Only support writing to array[array.length]. | 678 // Only support writing to array[array.length]. |
679 __ Branch(&slow, ne, key, Operand(t0)); | 679 __ Branch(&slow, ne, key, Operand(t0)); |
(...skipping 222 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 |