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 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 __ Ret(); | 675 __ Ret(); |
676 | 676 |
677 StubRuntimeCallHelper call_helper; | 677 StubRuntimeCallHelper call_helper; |
678 char_at_generator.GenerateSlow(masm, call_helper); | 678 char_at_generator.GenerateSlow(masm, call_helper); |
679 | 679 |
680 __ Bind(&miss); | 680 __ Bind(&miss); |
681 GenerateMiss(masm); | 681 GenerateMiss(masm); |
682 } | 682 } |
683 | 683 |
684 | 684 |
685 void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { | |
686 // Return address is in lr. | |
687 Label slow; | |
688 | |
689 Register receiver = LoadDescriptor::ReceiverRegister(); | |
690 Register key = LoadDescriptor::NameRegister(); | |
691 Register scratch1 = x3; | |
692 Register scratch2 = x4; | |
693 DCHECK(!AreAliased(scratch1, scratch2, receiver, key)); | |
694 | |
695 // Check that the receiver isn't a smi. | |
696 __ JumpIfSmi(receiver, &slow); | |
697 | |
698 // Check that the key is an array index, that is Uint32. | |
699 __ TestAndBranchIfAnySet(key, kSmiTagMask | kSmiSignMask, &slow); | |
700 | |
701 // Get the map of the receiver. | |
702 Register map = scratch1; | |
703 __ Ldr(map, FieldMemOperand(receiver, HeapObject::kMapOffset)); | |
704 | |
705 // Check that it has indexed interceptor and access checks | |
706 // are not enabled for this object. | |
707 __ Ldrb(scratch2, FieldMemOperand(map, Map::kBitFieldOffset)); | |
708 DCHECK(kSlowCaseBitFieldMask == ((1 << Map::kIsAccessCheckNeeded) | | |
709 (1 << Map::kHasIndexedInterceptor))); | |
710 __ Tbnz(scratch2, Map::kIsAccessCheckNeeded, &slow); | |
711 __ Tbz(scratch2, Map::kHasIndexedInterceptor, &slow); | |
712 | |
713 // Everything is fine, call runtime. | |
714 __ Push(receiver, key); | |
715 __ TailCallExternalReference( | |
716 ExternalReference(IC_Utility(kLoadElementWithInterceptor), | |
717 masm->isolate()), | |
718 2, 1); | |
719 | |
720 __ Bind(&slow); | |
721 GenerateMiss(masm); | |
722 } | |
723 | |
724 | |
725 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { | 685 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { |
726 ASM_LOCATION("KeyedStoreIC::GenerateMiss"); | 686 ASM_LOCATION("KeyedStoreIC::GenerateMiss"); |
727 | 687 |
728 // Push receiver, key and value for runtime call. | 688 // Push receiver, key and value for runtime call. |
729 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), | 689 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), |
730 StoreDescriptor::ValueRegister()); | 690 StoreDescriptor::ValueRegister()); |
731 | 691 |
732 ExternalReference ref = | 692 ExternalReference ref = |
733 ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate()); | 693 ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate()); |
734 __ TailCallExternalReference(ref, 3, 1); | 694 __ TailCallExternalReference(ref, 3, 1); |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1099 } else { | 1059 } else { |
1100 DCHECK(to_patch->Mask(TestBranchMask) == TBNZ); | 1060 DCHECK(to_patch->Mask(TestBranchMask) == TBNZ); |
1101 // This is JumpIfSmi(smi_reg, branch_imm). | 1061 // This is JumpIfSmi(smi_reg, branch_imm). |
1102 patcher.tbz(smi_reg, 0, branch_imm); | 1062 patcher.tbz(smi_reg, 0, branch_imm); |
1103 } | 1063 } |
1104 } | 1064 } |
1105 } | 1065 } |
1106 } // namespace v8::internal | 1066 } // namespace v8::internal |
1107 | 1067 |
1108 #endif // V8_TARGET_ARCH_ARM64 | 1068 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |