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_ARM | 5 #if V8_TARGET_ARCH_ARM |
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 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 Register vector = LoadWithVectorDescriptor::VectorRegister(); | 408 Register vector = LoadWithVectorDescriptor::VectorRegister(); |
409 Register slot = LoadWithVectorDescriptor::SlotRegister(); | 409 Register slot = LoadWithVectorDescriptor::SlotRegister(); |
410 DCHECK(!AreAliased(vector, slot, r4, r5, r6, r9)); | 410 DCHECK(!AreAliased(vector, slot, r4, r5, r6, r9)); |
411 Handle<TypeFeedbackVector> dummy_vector = | 411 Handle<TypeFeedbackVector> dummy_vector = |
412 TypeFeedbackVector::DummyVector(masm->isolate()); | 412 TypeFeedbackVector::DummyVector(masm->isolate()); |
413 int slot_index = dummy_vector->GetIndex( | 413 int slot_index = dummy_vector->GetIndex( |
414 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedLoadICSlot)); | 414 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedLoadICSlot)); |
415 __ LoadRoot(vector, Heap::kDummyVectorRootIndex); | 415 __ LoadRoot(vector, Heap::kDummyVectorRootIndex); |
416 __ mov(slot, Operand(Smi::FromInt(slot_index))); | 416 __ mov(slot, Operand(Smi::FromInt(slot_index))); |
417 | 417 |
418 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 418 Code::Flags flags = |
419 Code::ComputeHandlerFlags(Code::LOAD_IC)); | 419 Code::RemoveHolderFromFlags(Code::ComputeHandlerFlags(Code::LOAD_IC)); |
420 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::KEYED_LOAD_IC, flags, | 420 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::KEYED_LOAD_IC, flags, |
421 receiver, key, r4, r5, r6, r9); | 421 receiver, key, r4, r5, r6, r9); |
422 // Cache miss. | 422 // Cache miss. |
423 GenerateMiss(masm); | 423 GenerateMiss(masm); |
424 | 424 |
425 // Do a quick inline probe of the receiver's dictionary, if it | 425 // Do a quick inline probe of the receiver's dictionary, if it |
426 // exists. | 426 // exists. |
427 __ bind(&probe_dictionary); | 427 __ bind(&probe_dictionary); |
428 // r3: elements | 428 // r3: elements |
429 __ ldr(r0, FieldMemOperand(receiver, HeapObject::kMapOffset)); | 429 __ ldr(r0, FieldMemOperand(receiver, HeapObject::kMapOffset)); |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 Register slot = VectorStoreICDescriptor::SlotRegister(); | 675 Register slot = VectorStoreICDescriptor::SlotRegister(); |
676 | 676 |
677 DCHECK(!AreAliased(vector, slot, r5, temporary2, r6, r9)); | 677 DCHECK(!AreAliased(vector, slot, r5, temporary2, r6, r9)); |
678 Handle<TypeFeedbackVector> dummy_vector = | 678 Handle<TypeFeedbackVector> dummy_vector = |
679 TypeFeedbackVector::DummyVector(masm->isolate()); | 679 TypeFeedbackVector::DummyVector(masm->isolate()); |
680 int slot_index = dummy_vector->GetIndex( | 680 int slot_index = dummy_vector->GetIndex( |
681 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot)); | 681 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot)); |
682 __ LoadRoot(vector, Heap::kDummyVectorRootIndex); | 682 __ LoadRoot(vector, Heap::kDummyVectorRootIndex); |
683 __ mov(slot, Operand(Smi::FromInt(slot_index))); | 683 __ mov(slot, Operand(Smi::FromInt(slot_index))); |
684 | 684 |
685 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 685 Code::Flags flags = |
686 Code::ComputeHandlerFlags(Code::STORE_IC)); | 686 Code::RemoveHolderFromFlags(Code::ComputeHandlerFlags(Code::STORE_IC)); |
687 masm->isolate()->stub_cache()->GenerateProbe( | 687 masm->isolate()->stub_cache()->GenerateProbe( |
688 masm, Code::STORE_IC, flags, receiver, key, r5, temporary2, r6, r9); | 688 masm, Code::STORE_IC, flags, receiver, key, r5, temporary2, r6, r9); |
689 // Cache miss. | 689 // Cache miss. |
690 __ b(&miss); | 690 __ b(&miss); |
691 | 691 |
692 // Extra capacity case: Check if there is extra capacity to | 692 // Extra capacity case: Check if there is extra capacity to |
693 // perform the store and update the length. Used for adding one | 693 // perform the store and update the length. Used for adding one |
694 // element to the array by writing to array[array.length]. | 694 // element to the array by writing to array[array.length]. |
695 __ bind(&extra); | 695 __ bind(&extra); |
696 // Condition code from comparing key and array length is still available. | 696 // Condition code from comparing key and array length is still available. |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
736 | 736 |
737 | 737 |
738 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { | 738 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { |
739 Register receiver = StoreDescriptor::ReceiverRegister(); | 739 Register receiver = StoreDescriptor::ReceiverRegister(); |
740 Register name = StoreDescriptor::NameRegister(); | 740 Register name = StoreDescriptor::NameRegister(); |
741 DCHECK(receiver.is(r1)); | 741 DCHECK(receiver.is(r1)); |
742 DCHECK(name.is(r2)); | 742 DCHECK(name.is(r2)); |
743 DCHECK(StoreDescriptor::ValueRegister().is(r0)); | 743 DCHECK(StoreDescriptor::ValueRegister().is(r0)); |
744 | 744 |
745 // Get the receiver from the stack and probe the stub cache. | 745 // Get the receiver from the stack and probe the stub cache. |
746 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 746 Code::Flags flags = |
747 Code::ComputeHandlerFlags(Code::STORE_IC)); | 747 Code::RemoveHolderFromFlags(Code::ComputeHandlerFlags(Code::STORE_IC)); |
748 | 748 |
749 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::STORE_IC, flags, | 749 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::STORE_IC, flags, |
750 receiver, name, r3, r4, r5, r6); | 750 receiver, name, r3, r4, r5, r6); |
751 | 751 |
752 // Cache miss: Jump to runtime. | 752 // Cache miss: Jump to runtime. |
753 GenerateMiss(masm); | 753 GenerateMiss(masm); |
754 } | 754 } |
755 | 755 |
756 | 756 |
757 void StoreIC::GenerateMiss(MacroAssembler* masm) { | 757 void StoreIC::GenerateMiss(MacroAssembler* masm) { |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
879 patcher.EmitCondition(ne); | 879 patcher.EmitCondition(ne); |
880 } else { | 880 } else { |
881 DCHECK(Assembler::GetCondition(branch_instr) == ne); | 881 DCHECK(Assembler::GetCondition(branch_instr) == ne); |
882 patcher.EmitCondition(eq); | 882 patcher.EmitCondition(eq); |
883 } | 883 } |
884 } | 884 } |
885 } // namespace internal | 885 } // namespace internal |
886 } // namespace v8 | 886 } // namespace v8 |
887 | 887 |
888 #endif // V8_TARGET_ARCH_ARM | 888 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |