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 1339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1350 // Do we have a valid feedback vector? | 1350 // Do we have a valid feedback vector? |
1351 __ Ldr(index, FieldMemOperand(closure, JSFunction::kLiteralsOffset)); | 1351 __ Ldr(index, FieldMemOperand(closure, JSFunction::kLiteralsOffset)); |
1352 __ Ldr(index, FieldMemOperand(index, LiteralsArray::kFeedbackVectorOffset)); | 1352 __ Ldr(index, FieldMemOperand(index, LiteralsArray::kFeedbackVectorOffset)); |
1353 __ JumpIfRoot(index, Heap::kUndefinedValueRootIndex, &gotta_call_runtime); | 1353 __ JumpIfRoot(index, Heap::kUndefinedValueRootIndex, &gotta_call_runtime); |
1354 | 1354 |
1355 __ Ldr(map, FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset)); | 1355 __ Ldr(map, FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset)); |
1356 __ Ldr(map, | 1356 __ Ldr(map, |
1357 FieldMemOperand(map, SharedFunctionInfo::kOptimizedCodeMapOffset)); | 1357 FieldMemOperand(map, SharedFunctionInfo::kOptimizedCodeMapOffset)); |
1358 __ Ldrsw(index, UntagSmiFieldMemOperand(map, FixedArray::kLengthOffset)); | 1358 __ Ldrsw(index, UntagSmiFieldMemOperand(map, FixedArray::kLengthOffset)); |
1359 __ Cmp(index, Operand(2)); | 1359 __ Cmp(index, Operand(2)); |
1360 __ B(lt, &gotta_call_runtime); | 1360 __ B(lt, &try_shared); |
1361 | 1361 |
1362 // x3 : native context | 1362 // x3 : native context |
1363 // x2 : length / index | 1363 // x2 : length / index |
1364 // x13 : optimized code map | 1364 // x13 : optimized code map |
1365 // stack[0] : new target | 1365 // stack[0] : new target |
1366 // stack[4] : closure | 1366 // stack[4] : closure |
1367 Register native_context = x4; | 1367 Register native_context = x4; |
1368 __ Ldr(native_context, NativeContextMemOperand()); | 1368 __ Ldr(native_context, NativeContextMemOperand()); |
1369 | 1369 |
1370 __ Bind(&loop_top); | 1370 __ Bind(&loop_top); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1409 __ Mov(x5, closure); | 1409 __ Mov(x5, closure); |
1410 __ RecordWriteContextSlot(native_context, function_list_offset, x5, x13, | 1410 __ RecordWriteContextSlot(native_context, function_list_offset, x5, x13, |
1411 kLRHasNotBeenSaved, kDontSaveFPRegs); | 1411 kLRHasNotBeenSaved, kDontSaveFPRegs); |
1412 __ Jump(entry); | 1412 __ Jump(entry); |
1413 | 1413 |
1414 __ Bind(&loop_bottom); | 1414 __ Bind(&loop_bottom); |
1415 __ Sub(index, index, Operand(SharedFunctionInfo::kEntryLength)); | 1415 __ Sub(index, index, Operand(SharedFunctionInfo::kEntryLength)); |
1416 __ Cmp(index, Operand(1)); | 1416 __ Cmp(index, Operand(1)); |
1417 __ B(gt, &loop_top); | 1417 __ B(gt, &loop_top); |
1418 | 1418 |
1419 // We found no code. | 1419 // We found no code. Try the SharedFunctionInfo. |
1420 __ B(&gotta_call_runtime); | |
1421 | |
1422 __ Bind(&try_shared); | 1420 __ Bind(&try_shared); |
1423 __ Ldr(entry, | 1421 __ Ldr(entry, |
1424 FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset)); | 1422 FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset)); |
1425 // Is the shared function marked for tier up? | 1423 // Is the shared function marked for tier up? |
1426 __ Ldrb(temp, FieldMemOperand( | 1424 __ Ldrb(temp, FieldMemOperand( |
1427 entry, SharedFunctionInfo::kMarkedForTierUpByteOffset)); | 1425 entry, SharedFunctionInfo::kMarkedForTierUpByteOffset)); |
1428 __ TestAndBranchIfAnySet( | 1426 __ TestAndBranchIfAnySet( |
1429 temp, 1 << SharedFunctionInfo::kMarkedForTierUpBitWithinByte, | 1427 temp, 1 << SharedFunctionInfo::kMarkedForTierUpBitWithinByte, |
1430 &gotta_call_runtime); | 1428 &gotta_call_runtime); |
1431 | 1429 |
(...skipping 1559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2991 __ Unreachable(); | 2989 __ Unreachable(); |
2992 } | 2990 } |
2993 } | 2991 } |
2994 | 2992 |
2995 #undef __ | 2993 #undef __ |
2996 | 2994 |
2997 } // namespace internal | 2995 } // namespace internal |
2998 } // namespace v8 | 2996 } // namespace v8 |
2999 | 2997 |
3000 #endif // V8_TARGET_ARCH_ARM | 2998 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |