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 #if V8_TARGET_ARCH_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/base/division-by-constant.h" | 8 #include "src/base/division-by-constant.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 3800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3811 Ldrsw(scratch1, UntagSmiFieldMemOperand(scratch2, kDetailsOffset)); | 3811 Ldrsw(scratch1, UntagSmiFieldMemOperand(scratch2, kDetailsOffset)); |
3812 DCHECK_EQ(DATA, 0); | 3812 DCHECK_EQ(DATA, 0); |
3813 TestAndBranchIfAnySet(scratch1, PropertyDetails::TypeField::kMask, miss); | 3813 TestAndBranchIfAnySet(scratch1, PropertyDetails::TypeField::kMask, miss); |
3814 | 3814 |
3815 // Get the value at the masked, scaled index and return. | 3815 // Get the value at the masked, scaled index and return. |
3816 const int kValueOffset = | 3816 const int kValueOffset = |
3817 SeededNumberDictionary::kElementsStartOffset + kPointerSize; | 3817 SeededNumberDictionary::kElementsStartOffset + kPointerSize; |
3818 Ldr(result, FieldMemOperand(scratch2, kValueOffset)); | 3818 Ldr(result, FieldMemOperand(scratch2, kValueOffset)); |
3819 } | 3819 } |
3820 | 3820 |
| 3821 void MacroAssembler::RecordWriteCodeEntryField(Register js_function, |
| 3822 Register code_entry, |
| 3823 Register scratch) { |
| 3824 const int offset = JSFunction::kCodeEntryOffset; |
| 3825 |
| 3826 // Since a code entry (value) is always in old space, we don't need to update |
| 3827 // remembered set. If incremental marking is off, there is nothing for us to |
| 3828 // do. |
| 3829 if (!FLAG_incremental_marking) return; |
| 3830 |
| 3831 DCHECK(js_function.is(x1)); |
| 3832 DCHECK(code_entry.is(x7)); |
| 3833 DCHECK(scratch.is(x5)); |
| 3834 AssertNotSmi(js_function); |
| 3835 |
| 3836 if (emit_debug_code()) { |
| 3837 UseScratchRegisterScope temps(this); |
| 3838 Register temp = temps.AcquireX(); |
| 3839 Add(scratch, js_function, offset - kHeapObjectTag); |
| 3840 Ldr(temp, MemOperand(scratch)); |
| 3841 Cmp(temp, code_entry); |
| 3842 Check(eq, kWrongAddressOrValuePassedToRecordWrite); |
| 3843 } |
| 3844 |
| 3845 // First, check if a write barrier is even needed. The tests below |
| 3846 // catch stores of Smis and stores into young gen. |
| 3847 Label done; |
| 3848 |
| 3849 CheckPageFlagClear(code_entry, scratch, |
| 3850 MemoryChunk::kPointersToHereAreInterestingMask, &done); |
| 3851 CheckPageFlagClear(js_function, scratch, |
| 3852 MemoryChunk::kPointersFromHereAreInterestingMask, &done); |
| 3853 |
| 3854 const Register dst = scratch; |
| 3855 Add(dst, js_function, offset - kHeapObjectTag); |
| 3856 |
| 3857 // Save caller-saved registers.Both input registers (x1 and x7) are caller |
| 3858 // saved, so there is no need to push them. |
| 3859 PushCPURegList(kCallerSaved); |
| 3860 |
| 3861 int argument_count = 3; |
| 3862 |
| 3863 Mov(x0, js_function); |
| 3864 Mov(x1, dst); |
| 3865 Mov(x2, ExternalReference::isolate_address(isolate())); |
| 3866 |
| 3867 { |
| 3868 AllowExternalCallThatCantCauseGC scope(this); |
| 3869 CallCFunction( |
| 3870 ExternalReference::incremental_marking_record_write_code_entry_function( |
| 3871 isolate()), |
| 3872 argument_count); |
| 3873 } |
| 3874 |
| 3875 // Restore caller-saved registers. |
| 3876 PopCPURegList(kCallerSaved); |
| 3877 |
| 3878 Bind(&done); |
| 3879 } |
3821 | 3880 |
3822 void MacroAssembler::RememberedSetHelper(Register object, // For debug tests. | 3881 void MacroAssembler::RememberedSetHelper(Register object, // For debug tests. |
3823 Register address, | 3882 Register address, |
3824 Register scratch1, | 3883 Register scratch1, |
3825 SaveFPRegsMode fp_mode, | 3884 SaveFPRegsMode fp_mode, |
3826 RememberedSetFinalAction and_then) { | 3885 RememberedSetFinalAction and_then) { |
3827 DCHECK(!AreAliased(object, address, scratch1)); | 3886 DCHECK(!AreAliased(object, address, scratch1)); |
3828 Label done, store_buffer_overflow; | 3887 Label done, store_buffer_overflow; |
3829 if (emit_debug_code()) { | 3888 if (emit_debug_code()) { |
3830 Label ok; | 3889 Label ok; |
(...skipping 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4894 } | 4953 } |
4895 | 4954 |
4896 | 4955 |
4897 #undef __ | 4956 #undef __ |
4898 | 4957 |
4899 | 4958 |
4900 } // namespace internal | 4959 } // namespace internal |
4901 } // namespace v8 | 4960 } // namespace v8 |
4902 | 4961 |
4903 #endif // V8_TARGET_ARCH_ARM64 | 4962 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |