OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
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 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 | 464 |
465 GenerateKeyedLoadWithNameKey(masm, key, receiver, x4, x5, x6, x7, x3, &slow); | 465 GenerateKeyedLoadWithNameKey(masm, key, receiver, x4, x5, x6, x7, x3, &slow); |
466 | 466 |
467 __ Bind(&index_name); | 467 __ Bind(&index_name); |
468 __ IndexFromHash(x3, key); | 468 __ IndexFromHash(x3, 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) { |
| 475 if (FLAG_vector_stores) { |
| 476 __ Push(StoreDescriptor::ReceiverRegister(), |
| 477 StoreDescriptor::NameRegister(), StoreDescriptor::ValueRegister(), |
| 478 VectorStoreICDescriptor::SlotRegister(), |
| 479 VectorStoreICDescriptor::VectorRegister()); |
| 480 } else { |
| 481 __ Push(StoreDescriptor::ReceiverRegister(), |
| 482 StoreDescriptor::NameRegister(), StoreDescriptor::ValueRegister()); |
| 483 } |
| 484 } |
| 485 |
| 486 |
474 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { | 487 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { |
475 ASM_LOCATION("KeyedStoreIC::GenerateMiss"); | 488 ASM_LOCATION("KeyedStoreIC::GenerateMiss"); |
| 489 StoreIC_PushArgs(masm); |
476 | 490 |
477 // Push receiver, key and value for runtime call. | 491 int args = FLAG_vector_stores ? 5 : 3; |
478 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), | 492 __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss, args, 1); |
479 StoreDescriptor::ValueRegister()); | |
480 | |
481 __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss, 3, 1); | |
482 } | 493 } |
483 | 494 |
484 | 495 |
485 static void KeyedStoreGenerateMegamorphicHelper( | 496 static void KeyedStoreGenerateMegamorphicHelper( |
486 MacroAssembler* masm, Label* fast_object, Label* fast_double, Label* slow, | 497 MacroAssembler* masm, Label* fast_object, Label* fast_double, Label* slow, |
487 KeyedStoreCheckMap check_map, KeyedStoreIncrementLength increment_length, | 498 KeyedStoreCheckMap check_map, KeyedStoreIncrementLength increment_length, |
488 Register value, Register key, Register receiver, Register receiver_map, | 499 Register value, Register key, Register receiver, Register receiver_map, |
489 Register elements_map, Register elements) { | 500 Register elements_map, Register elements) { |
490 DCHECK(!AreAliased(value, key, receiver, receiver_map, elements_map, elements, | 501 DCHECK(!AreAliased(value, key, receiver, receiver_map, elements_map, elements, |
491 x10, x11)); | 502 x10, x11)); |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 Code::ComputeHandlerFlags(Code::STORE_IC)); | 769 Code::ComputeHandlerFlags(Code::STORE_IC)); |
759 masm->isolate()->stub_cache()->GenerateProbe( | 770 masm->isolate()->stub_cache()->GenerateProbe( |
760 masm, Code::STORE_IC, flags, false, receiver, name, x3, x4, x5, x6); | 771 masm, Code::STORE_IC, flags, false, receiver, name, x3, x4, x5, x6); |
761 | 772 |
762 // Cache miss: Jump to runtime. | 773 // Cache miss: Jump to runtime. |
763 GenerateMiss(masm); | 774 GenerateMiss(masm); |
764 } | 775 } |
765 | 776 |
766 | 777 |
767 void StoreIC::GenerateMiss(MacroAssembler* masm) { | 778 void StoreIC::GenerateMiss(MacroAssembler* masm) { |
768 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), | 779 StoreIC_PushArgs(masm); |
769 StoreDescriptor::ValueRegister()); | |
770 | 780 |
771 // Tail call to the entry. | 781 // Tail call to the entry. |
772 __ TailCallRuntime(Runtime::kStoreIC_Miss, 3, 1); | 782 int args = FLAG_vector_stores ? 5 : 3; |
| 783 __ TailCallRuntime(Runtime::kStoreIC_Miss, args, 1); |
773 } | 784 } |
774 | 785 |
775 | 786 |
776 void StoreIC::GenerateNormal(MacroAssembler* masm) { | 787 void StoreIC::GenerateNormal(MacroAssembler* masm) { |
777 Label miss; | 788 Label miss; |
778 Register value = StoreDescriptor::ValueRegister(); | 789 Register value = StoreDescriptor::ValueRegister(); |
779 Register receiver = StoreDescriptor::ReceiverRegister(); | 790 Register receiver = StoreDescriptor::ReceiverRegister(); |
780 Register name = StoreDescriptor::NameRegister(); | 791 Register name = StoreDescriptor::NameRegister(); |
781 Register dictionary = x3; | 792 Register dictionary = x3; |
782 DCHECK(!AreAliased(value, receiver, name, x3, x4, x5)); | 793 DCHECK(!AreAliased(value, receiver, name, x3, x4, x5)); |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
877 } else { | 888 } else { |
878 DCHECK(to_patch->Mask(TestBranchMask) == TBNZ); | 889 DCHECK(to_patch->Mask(TestBranchMask) == TBNZ); |
879 // This is JumpIfSmi(smi_reg, branch_imm). | 890 // This is JumpIfSmi(smi_reg, branch_imm). |
880 patcher.tbz(smi_reg, 0, branch_imm); | 891 patcher.tbz(smi_reg, 0, branch_imm); |
881 } | 892 } |
882 } | 893 } |
883 } // namespace internal | 894 } // namespace internal |
884 } // namespace v8 | 895 } // namespace v8 |
885 | 896 |
886 #endif // V8_TARGET_ARCH_ARM64 | 897 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |