| 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 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 __ Ret(); | 465 __ Ret(); |
| 466 | 466 |
| 467 __ bind(&index_name); | 467 __ bind(&index_name); |
| 468 __ IndexFromHash(r6, key); | 468 __ IndexFromHash(r6, key); |
| 469 // Now jump to the place where smi keys are handled. | 469 // Now jump to the place where smi keys are handled. |
| 470 __ b(&index_smi); | 470 __ b(&index_smi); |
| 471 } | 471 } |
| 472 | 472 |
| 473 | 473 |
| 474 static void StoreIC_PushArgs(MacroAssembler* masm) { | 474 static void StoreIC_PushArgs(MacroAssembler* masm) { |
| 475 if (FLAG_vector_stores) { | 475 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), |
| 476 __ Push(StoreDescriptor::ReceiverRegister(), | 476 StoreDescriptor::ValueRegister(), |
| 477 StoreDescriptor::NameRegister(), StoreDescriptor::ValueRegister(), | 477 VectorStoreICDescriptor::SlotRegister(), |
| 478 VectorStoreICDescriptor::SlotRegister(), | 478 VectorStoreICDescriptor::VectorRegister()); |
| 479 VectorStoreICDescriptor::VectorRegister()); | |
| 480 } else { | |
| 481 __ Push(StoreDescriptor::ReceiverRegister(), | |
| 482 StoreDescriptor::NameRegister(), StoreDescriptor::ValueRegister()); | |
| 483 } | |
| 484 } | 479 } |
| 485 | 480 |
| 486 | 481 |
| 487 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { | 482 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { |
| 488 StoreIC_PushArgs(masm); | 483 StoreIC_PushArgs(masm); |
| 489 | 484 |
| 490 int args = FLAG_vector_stores ? 5 : 3; | 485 __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss, 5, 1); |
| 491 __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss, args, 1); | |
| 492 } | 486 } |
| 493 | 487 |
| 494 | 488 |
| 495 static void KeyedStoreGenerateMegamorphicHelper( | 489 static void KeyedStoreGenerateMegamorphicHelper( |
| 496 MacroAssembler* masm, Label* fast_object, Label* fast_double, Label* slow, | 490 MacroAssembler* masm, Label* fast_object, Label* fast_double, Label* slow, |
| 497 KeyedStoreCheckMap check_map, KeyedStoreIncrementLength increment_length, | 491 KeyedStoreCheckMap check_map, KeyedStoreIncrementLength increment_length, |
| 498 Register value, Register key, Register receiver, Register receiver_map, | 492 Register value, Register key, Register receiver, Register receiver_map, |
| 499 Register elements_map, Register elements) { | 493 Register elements_map, Register elements) { |
| 500 Label transition_smi_elements; | 494 Label transition_smi_elements; |
| 501 Label finish_object_store, non_double_value, transition_double_elements; | 495 Label finish_object_store, non_double_value, transition_double_elements; |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 // r4: key. | 691 // r4: key. |
| 698 // r5: receiver. | 692 // r5: receiver. |
| 699 PropertyICCompiler::GenerateRuntimeSetProperty(masm, language_mode); | 693 PropertyICCompiler::GenerateRuntimeSetProperty(masm, language_mode); |
| 700 // Never returns to here. | 694 // Never returns to here. |
| 701 | 695 |
| 702 __ bind(&maybe_name_key); | 696 __ bind(&maybe_name_key); |
| 703 __ LoadP(r7, FieldMemOperand(key, HeapObject::kMapOffset)); | 697 __ LoadP(r7, FieldMemOperand(key, HeapObject::kMapOffset)); |
| 704 __ lbz(r7, FieldMemOperand(r7, Map::kInstanceTypeOffset)); | 698 __ lbz(r7, FieldMemOperand(r7, Map::kInstanceTypeOffset)); |
| 705 __ JumpIfNotUniqueNameInstanceType(r7, &slow); | 699 __ JumpIfNotUniqueNameInstanceType(r7, &slow); |
| 706 | 700 |
| 707 if (FLAG_vector_stores) { | 701 // The handlers in the stub cache expect a vector and slot. Since we won't |
| 708 // The handlers in the stub cache expect a vector and slot. Since we won't | 702 // change the IC from any downstream misses, a dummy vector can be used. |
| 709 // change the IC from any downstream misses, a dummy vector can be used. | 703 Register vector = VectorStoreICDescriptor::VectorRegister(); |
| 710 Register vector = VectorStoreICDescriptor::VectorRegister(); | 704 Register slot = VectorStoreICDescriptor::SlotRegister(); |
| 711 Register slot = VectorStoreICDescriptor::SlotRegister(); | 705 DCHECK(!AreAliased(vector, slot, r8, r9, r10, r11)); |
| 712 DCHECK(!AreAliased(vector, slot, r8, r9, r10, r11)); | 706 Handle<TypeFeedbackVector> dummy_vector = |
| 713 Handle<TypeFeedbackVector> dummy_vector = | 707 TypeFeedbackVector::DummyVector(masm->isolate()); |
| 714 TypeFeedbackVector::DummyVector(masm->isolate()); | 708 int slot_index = dummy_vector->GetIndex( |
| 715 int slot_index = dummy_vector->GetIndex( | 709 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot)); |
| 716 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot)); | 710 __ LoadRoot(vector, Heap::kDummyVectorRootIndex); |
| 717 __ LoadRoot(vector, Heap::kDummyVectorRootIndex); | 711 __ LoadSmiLiteral(slot, Smi::FromInt(slot_index)); |
| 718 __ LoadSmiLiteral(slot, Smi::FromInt(slot_index)); | |
| 719 } | |
| 720 | 712 |
| 721 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 713 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
| 722 Code::ComputeHandlerFlags(Code::STORE_IC)); | 714 Code::ComputeHandlerFlags(Code::STORE_IC)); |
| 723 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::STORE_IC, flags, | 715 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::STORE_IC, flags, |
| 724 receiver, key, r8, r9, r10, r11); | 716 receiver, key, r8, r9, r10, r11); |
| 725 // Cache miss. | 717 // Cache miss. |
| 726 __ b(&miss); | 718 __ b(&miss); |
| 727 | 719 |
| 728 // Extra capacity case: Check if there is extra capacity to | 720 // Extra capacity case: Check if there is extra capacity to |
| 729 // perform the store and update the length. Used for adding one | 721 // perform the store and update the length. Used for adding one |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 787 | 779 |
| 788 // Cache miss: Jump to runtime. | 780 // Cache miss: Jump to runtime. |
| 789 GenerateMiss(masm); | 781 GenerateMiss(masm); |
| 790 } | 782 } |
| 791 | 783 |
| 792 | 784 |
| 793 void StoreIC::GenerateMiss(MacroAssembler* masm) { | 785 void StoreIC::GenerateMiss(MacroAssembler* masm) { |
| 794 StoreIC_PushArgs(masm); | 786 StoreIC_PushArgs(masm); |
| 795 | 787 |
| 796 // Perform tail call to the entry. | 788 // Perform tail call to the entry. |
| 797 int args = FLAG_vector_stores ? 5 : 3; | 789 __ TailCallRuntime(Runtime::kStoreIC_Miss, 5, 1); |
| 798 __ TailCallRuntime(Runtime::kStoreIC_Miss, args, 1); | |
| 799 } | 790 } |
| 800 | 791 |
| 801 | 792 |
| 802 void StoreIC::GenerateNormal(MacroAssembler* masm) { | 793 void StoreIC::GenerateNormal(MacroAssembler* masm) { |
| 803 Label miss; | 794 Label miss; |
| 804 Register receiver = StoreDescriptor::ReceiverRegister(); | 795 Register receiver = StoreDescriptor::ReceiverRegister(); |
| 805 Register name = StoreDescriptor::NameRegister(); | 796 Register name = StoreDescriptor::NameRegister(); |
| 806 Register value = StoreDescriptor::ValueRegister(); | 797 Register value = StoreDescriptor::ValueRegister(); |
| 807 Register dictionary = r8; | 798 Register dictionary = r8; |
| 808 DCHECK(receiver.is(r4)); | 799 DCHECK(receiver.is(r4)); |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 919 patcher.EmitCondition(ne); | 910 patcher.EmitCondition(ne); |
| 920 } else { | 911 } else { |
| 921 DCHECK(Assembler::GetCondition(branch_instr) == ne); | 912 DCHECK(Assembler::GetCondition(branch_instr) == ne); |
| 922 patcher.EmitCondition(eq); | 913 patcher.EmitCondition(eq); |
| 923 } | 914 } |
| 924 } | 915 } |
| 925 } // namespace internal | 916 } // namespace internal |
| 926 } // namespace v8 | 917 } // namespace v8 |
| 927 | 918 |
| 928 #endif // V8_TARGET_ARCH_PPC | 919 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |