OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
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 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 DCHECK(!AreAliased(vector, slot, r7, r8, r9, r10)); | 441 DCHECK(!AreAliased(vector, slot, r7, r8, r9, r10)); |
442 Handle<TypeFeedbackVector> dummy_vector = | 442 Handle<TypeFeedbackVector> dummy_vector = |
443 TypeFeedbackVector::DummyVector(masm->isolate()); | 443 TypeFeedbackVector::DummyVector(masm->isolate()); |
444 int slot_index = dummy_vector->GetIndex( | 444 int slot_index = dummy_vector->GetIndex( |
445 FeedbackVectorICSlot(TypeFeedbackVector::kDummyKeyedLoadICSlot)); | 445 FeedbackVectorICSlot(TypeFeedbackVector::kDummyKeyedLoadICSlot)); |
446 __ LoadRoot(vector, Heap::kDummyVectorRootIndex); | 446 __ LoadRoot(vector, Heap::kDummyVectorRootIndex); |
447 __ LoadSmiLiteral(slot, Smi::FromInt(slot_index)); | 447 __ LoadSmiLiteral(slot, Smi::FromInt(slot_index)); |
448 | 448 |
449 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 449 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
450 Code::ComputeHandlerFlags(Code::LOAD_IC)); | 450 Code::ComputeHandlerFlags(Code::LOAD_IC)); |
451 masm->isolate()->stub_cache()->GenerateProbe( | 451 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::KEYED_LOAD_IC, flags, |
452 masm, Code::KEYED_LOAD_IC, flags, false, receiver, key, r7, r8, r9, r10); | 452 receiver, key, r7, r8, r9, r10); |
453 // Cache miss. | 453 // Cache miss. |
454 GenerateMiss(masm); | 454 GenerateMiss(masm); |
455 | 455 |
456 // Do a quick inline probe of the receiver's dictionary, if it | 456 // Do a quick inline probe of the receiver's dictionary, if it |
457 // exists. | 457 // exists. |
458 __ bind(&probe_dictionary); | 458 __ bind(&probe_dictionary); |
459 // r6: elements | 459 // r6: elements |
460 __ LoadP(r3, FieldMemOperand(receiver, HeapObject::kMapOffset)); | 460 __ LoadP(r3, FieldMemOperand(receiver, HeapObject::kMapOffset)); |
461 __ lbz(r3, FieldMemOperand(r3, Map::kInstanceTypeOffset)); | 461 __ lbz(r3, FieldMemOperand(r3, Map::kInstanceTypeOffset)); |
462 GenerateGlobalInstanceTypeCheck(masm, r3, &slow); | 462 GenerateGlobalInstanceTypeCheck(masm, r3, &slow); |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
715 Handle<TypeFeedbackVector> dummy_vector = | 715 Handle<TypeFeedbackVector> dummy_vector = |
716 TypeFeedbackVector::DummyVector(masm->isolate()); | 716 TypeFeedbackVector::DummyVector(masm->isolate()); |
717 int slot_index = dummy_vector->GetIndex( | 717 int slot_index = dummy_vector->GetIndex( |
718 FeedbackVectorICSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot)); | 718 FeedbackVectorICSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot)); |
719 __ LoadRoot(vector, Heap::kDummyVectorRootIndex); | 719 __ LoadRoot(vector, Heap::kDummyVectorRootIndex); |
720 __ LoadSmiLiteral(slot, Smi::FromInt(slot_index)); | 720 __ LoadSmiLiteral(slot, Smi::FromInt(slot_index)); |
721 } | 721 } |
722 | 722 |
723 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 723 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
724 Code::ComputeHandlerFlags(Code::STORE_IC)); | 724 Code::ComputeHandlerFlags(Code::STORE_IC)); |
725 masm->isolate()->stub_cache()->GenerateProbe( | 725 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::STORE_IC, flags, |
726 masm, Code::STORE_IC, flags, false, receiver, key, r6, r7, r8, r9); | 726 receiver, key, r6, r7, r8, r9); |
727 // Cache miss. | 727 // Cache miss. |
728 __ b(&miss); | 728 __ b(&miss); |
729 | 729 |
730 // Extra capacity case: Check if there is extra capacity to | 730 // Extra capacity case: Check if there is extra capacity to |
731 // perform the store and update the length. Used for adding one | 731 // perform the store and update the length. Used for adding one |
732 // element to the array by writing to array[array.length]. | 732 // element to the array by writing to array[array.length]. |
733 __ bind(&extra); | 733 __ bind(&extra); |
734 // Condition code from comparing key and array length is still available. | 734 // Condition code from comparing key and array length is still available. |
735 __ bne(&slow); // Only support writing to writing to array[array.length]. | 735 __ bne(&slow); // Only support writing to writing to array[array.length]. |
736 // Check for room in the elements backing store. | 736 // Check for room in the elements backing store. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 Register receiver = StoreDescriptor::ReceiverRegister(); | 777 Register receiver = StoreDescriptor::ReceiverRegister(); |
778 Register name = StoreDescriptor::NameRegister(); | 778 Register name = StoreDescriptor::NameRegister(); |
779 DCHECK(receiver.is(r4)); | 779 DCHECK(receiver.is(r4)); |
780 DCHECK(name.is(r5)); | 780 DCHECK(name.is(r5)); |
781 DCHECK(StoreDescriptor::ValueRegister().is(r3)); | 781 DCHECK(StoreDescriptor::ValueRegister().is(r3)); |
782 | 782 |
783 // Get the receiver from the stack and probe the stub cache. | 783 // Get the receiver from the stack and probe the stub cache. |
784 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 784 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
785 Code::ComputeHandlerFlags(Code::STORE_IC)); | 785 Code::ComputeHandlerFlags(Code::STORE_IC)); |
786 | 786 |
787 masm->isolate()->stub_cache()->GenerateProbe( | 787 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::STORE_IC, flags, |
788 masm, Code::STORE_IC, flags, false, receiver, name, r6, r7, r8, r9); | 788 receiver, name, r6, r7, r8, r9); |
789 | 789 |
790 // Cache miss: Jump to runtime. | 790 // Cache miss: Jump to runtime. |
791 GenerateMiss(masm); | 791 GenerateMiss(masm); |
792 } | 792 } |
793 | 793 |
794 | 794 |
795 void StoreIC::GenerateMiss(MacroAssembler* masm) { | 795 void StoreIC::GenerateMiss(MacroAssembler* masm) { |
796 StoreIC_PushArgs(masm); | 796 StoreIC_PushArgs(masm); |
797 | 797 |
798 // Perform tail call to the entry. | 798 // Perform tail call to the entry. |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
919 patcher.EmitCondition(ne); | 919 patcher.EmitCondition(ne); |
920 } else { | 920 } else { |
921 DCHECK(Assembler::GetCondition(branch_instr) == ne); | 921 DCHECK(Assembler::GetCondition(branch_instr) == ne); |
922 patcher.EmitCondition(eq); | 922 patcher.EmitCondition(eq); |
923 } | 923 } |
924 } | 924 } |
925 } // namespace internal | 925 } // namespace internal |
926 } // namespace v8 | 926 } // namespace v8 |
927 | 927 |
928 #endif // V8_TARGET_ARCH_PPC | 928 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |