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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_PPC | 7 #if V8_TARGET_ARCH_PPC |
8 | 8 |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/ic/ic.h" | 10 #include "src/ic/ic.h" |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 r6); | 467 r6); |
468 __ Ret(); | 468 __ Ret(); |
469 | 469 |
470 __ bind(&index_name); | 470 __ bind(&index_name); |
471 __ IndexFromHash(r6, key); | 471 __ IndexFromHash(r6, key); |
472 // Now jump to the place where smi keys are handled. | 472 // Now jump to the place where smi keys are handled. |
473 __ b(&index_smi); | 473 __ b(&index_smi); |
474 } | 474 } |
475 | 475 |
476 | 476 |
| 477 static void StoreIC_PushArgs(MacroAssembler* masm) { |
| 478 if (FLAG_vector_stores) { |
| 479 __ Push(StoreDescriptor::ReceiverRegister(), |
| 480 StoreDescriptor::NameRegister(), StoreDescriptor::ValueRegister(), |
| 481 VectorStoreICDescriptor::SlotRegister(), |
| 482 VectorStoreICDescriptor::VectorRegister()); |
| 483 } else { |
| 484 __ Push(StoreDescriptor::ReceiverRegister(), |
| 485 StoreDescriptor::NameRegister(), StoreDescriptor::ValueRegister()); |
| 486 } |
| 487 } |
| 488 |
| 489 |
477 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { | 490 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { |
478 // Push receiver, key and value for runtime call. | 491 StoreIC_PushArgs(masm); |
479 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), | |
480 StoreDescriptor::ValueRegister()); | |
481 | 492 |
482 __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss, 3, 1); | 493 int args = FLAG_vector_stores ? 5 : 3; |
| 494 __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss, args, 1); |
483 } | 495 } |
484 | 496 |
485 | 497 |
486 static void KeyedStoreGenerateMegamorphicHelper( | 498 static void KeyedStoreGenerateMegamorphicHelper( |
487 MacroAssembler* masm, Label* fast_object, Label* fast_double, Label* slow, | 499 MacroAssembler* masm, Label* fast_object, Label* fast_double, Label* slow, |
488 KeyedStoreCheckMap check_map, KeyedStoreIncrementLength increment_length, | 500 KeyedStoreCheckMap check_map, KeyedStoreIncrementLength increment_length, |
489 Register value, Register key, Register receiver, Register receiver_map, | 501 Register value, Register key, Register receiver, Register receiver_map, |
490 Register elements_map, Register elements) { | 502 Register elements_map, Register elements) { |
491 Label transition_smi_elements; | 503 Label transition_smi_elements; |
492 Label finish_object_store, non_double_value, transition_double_elements; | 504 Label finish_object_store, non_double_value, transition_double_elements; |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
774 | 786 |
775 masm->isolate()->stub_cache()->GenerateProbe( | 787 masm->isolate()->stub_cache()->GenerateProbe( |
776 masm, Code::STORE_IC, flags, false, receiver, name, r6, r7, r8, r9); | 788 masm, Code::STORE_IC, flags, false, receiver, name, r6, r7, r8, r9); |
777 | 789 |
778 // Cache miss: Jump to runtime. | 790 // Cache miss: Jump to runtime. |
779 GenerateMiss(masm); | 791 GenerateMiss(masm); |
780 } | 792 } |
781 | 793 |
782 | 794 |
783 void StoreIC::GenerateMiss(MacroAssembler* masm) { | 795 void StoreIC::GenerateMiss(MacroAssembler* masm) { |
784 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), | 796 StoreIC_PushArgs(masm); |
785 StoreDescriptor::ValueRegister()); | |
786 | 797 |
787 // Perform tail call to the entry. | 798 // Perform tail call to the entry. |
788 __ TailCallRuntime(Runtime::kStoreIC_Miss, 3, 1); | 799 int args = FLAG_vector_stores ? 5 : 3; |
| 800 __ TailCallRuntime(Runtime::kStoreIC_Miss, args, 1); |
789 } | 801 } |
790 | 802 |
791 | 803 |
792 void StoreIC::GenerateNormal(MacroAssembler* masm) { | 804 void StoreIC::GenerateNormal(MacroAssembler* masm) { |
793 Label miss; | 805 Label miss; |
794 Register receiver = StoreDescriptor::ReceiverRegister(); | 806 Register receiver = StoreDescriptor::ReceiverRegister(); |
795 Register name = StoreDescriptor::NameRegister(); | 807 Register name = StoreDescriptor::NameRegister(); |
796 Register value = StoreDescriptor::ValueRegister(); | 808 Register value = StoreDescriptor::ValueRegister(); |
797 Register dictionary = r6; | 809 Register dictionary = r6; |
798 DCHECK(receiver.is(r4)); | 810 DCHECK(receiver.is(r4)); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
907 patcher.EmitCondition(ne); | 919 patcher.EmitCondition(ne); |
908 } else { | 920 } else { |
909 DCHECK(Assembler::GetCondition(branch_instr) == ne); | 921 DCHECK(Assembler::GetCondition(branch_instr) == ne); |
910 patcher.EmitCondition(eq); | 922 patcher.EmitCondition(eq); |
911 } | 923 } |
912 } | 924 } |
913 } // namespace internal | 925 } // namespace internal |
914 } // namespace v8 | 926 } // namespace v8 |
915 | 927 |
916 #endif // V8_TARGET_ARCH_PPC | 928 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |