| 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/arm64/frames-arm64.h" | 7 #include "src/arm64/frames-arm64.h" |
| 8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
| 9 #include "src/debug/debug.h" | 9 #include "src/debug/debug.h" |
| 10 #include "src/deoptimizer.h" | 10 #include "src/deoptimizer.h" |
| (...skipping 1319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1330 SharedFunctionInfo::kOffsetToPreviousContext)); | 1330 SharedFunctionInfo::kOffsetToPreviousContext)); |
| 1331 __ Ldr(temp, FieldMemOperand(temp, WeakCell::kValueOffset)); | 1331 __ Ldr(temp, FieldMemOperand(temp, WeakCell::kValueOffset)); |
| 1332 __ Cmp(temp, native_context); | 1332 __ Cmp(temp, native_context); |
| 1333 __ B(ne, &loop_bottom); | 1333 __ B(ne, &loop_bottom); |
| 1334 // OSR id set to none? | 1334 // OSR id set to none? |
| 1335 __ Ldr(temp, FieldMemOperand(array_pointer, | 1335 __ Ldr(temp, FieldMemOperand(array_pointer, |
| 1336 SharedFunctionInfo::kOffsetToPreviousOsrAstId)); | 1336 SharedFunctionInfo::kOffsetToPreviousOsrAstId)); |
| 1337 const int bailout_id = BailoutId::None().ToInt(); | 1337 const int bailout_id = BailoutId::None().ToInt(); |
| 1338 __ Cmp(temp, Operand(Smi::FromInt(bailout_id))); | 1338 __ Cmp(temp, Operand(Smi::FromInt(bailout_id))); |
| 1339 __ B(ne, &loop_bottom); | 1339 __ B(ne, &loop_bottom); |
| 1340 | |
| 1341 // Literals available? | 1340 // Literals available? |
| 1342 Label got_literals, maybe_cleared_weakcell; | |
| 1343 Register temp2 = x7; | |
| 1344 __ Ldr(temp, FieldMemOperand(array_pointer, | 1341 __ Ldr(temp, FieldMemOperand(array_pointer, |
| 1345 SharedFunctionInfo::kOffsetToPreviousLiterals)); | 1342 SharedFunctionInfo::kOffsetToPreviousLiterals)); |
| 1346 // temp contains either a WeakCell pointing to the literals array or the | |
| 1347 // literals array directly. | |
| 1348 STATIC_ASSERT(WeakCell::kValueOffset == FixedArray::kLengthOffset); | |
| 1349 __ Ldr(temp2, FieldMemOperand(temp, WeakCell::kValueOffset)); | |
| 1350 __ JumpIfSmi(temp2, &maybe_cleared_weakcell); | |
| 1351 // temp2 is a pointer, therefore temp is a WeakCell pointing to a literals | |
| 1352 // array. | |
| 1353 __ Ldr(temp, FieldMemOperand(temp, WeakCell::kValueOffset)); | 1343 __ Ldr(temp, FieldMemOperand(temp, WeakCell::kValueOffset)); |
| 1354 __ jmp(&got_literals); | 1344 __ JumpIfSmi(temp, &gotta_call_runtime); |
| 1355 | |
| 1356 // r4 is a smi. If it's 0, then we are looking at a cleared WeakCell | |
| 1357 // around the literals array, and we should visit the runtime. If it's > 0, | |
| 1358 // then temp already contains the literals array. | |
| 1359 __ bind(&maybe_cleared_weakcell); | |
| 1360 __ Cmp(temp2, Operand(Smi::FromInt(0))); | |
| 1361 __ B(eq, &gotta_call_runtime); | |
| 1362 | 1345 |
| 1363 // Save the literals in the closure. | 1346 // Save the literals in the closure. |
| 1364 __ bind(&got_literals); | |
| 1365 __ Str(temp, FieldMemOperand(closure, JSFunction::kLiteralsOffset)); | 1347 __ Str(temp, FieldMemOperand(closure, JSFunction::kLiteralsOffset)); |
| 1366 __ RecordWriteField(closure, JSFunction::kLiteralsOffset, temp, x7, | 1348 __ RecordWriteField(closure, JSFunction::kLiteralsOffset, temp, x7, |
| 1367 kLRHasNotBeenSaved, kDontSaveFPRegs, EMIT_REMEMBERED_SET, | 1349 kLRHasNotBeenSaved, kDontSaveFPRegs, EMIT_REMEMBERED_SET, |
| 1368 OMIT_SMI_CHECK); | 1350 OMIT_SMI_CHECK); |
| 1369 | 1351 |
| 1370 // Code available? | 1352 // Code available? |
| 1371 Register entry = x7; | 1353 Register entry = x7; |
| 1372 __ Ldr(entry, | 1354 __ Ldr(entry, |
| 1373 FieldMemOperand(array_pointer, | 1355 FieldMemOperand(array_pointer, |
| 1374 SharedFunctionInfo::kOffsetToPreviousCachedCode)); | 1356 SharedFunctionInfo::kOffsetToPreviousCachedCode)); |
| (...skipping 1673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3048 __ Unreachable(); | 3030 __ Unreachable(); |
| 3049 } | 3031 } |
| 3050 } | 3032 } |
| 3051 | 3033 |
| 3052 #undef __ | 3034 #undef __ |
| 3053 | 3035 |
| 3054 } // namespace internal | 3036 } // namespace internal |
| 3055 } // namespace v8 | 3037 } // namespace v8 |
| 3056 | 3038 |
| 3057 #endif // V8_TARGET_ARCH_ARM | 3039 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |