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 1288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1299 ArrayConstructorStub stub(masm->isolate()); | 1299 ArrayConstructorStub stub(masm->isolate()); |
1300 __ TailCallStub(&stub); | 1300 __ TailCallStub(&stub); |
1301 | 1301 |
1302 __ bind(&stack_overflow); | 1302 __ bind(&stack_overflow); |
1303 { | 1303 { |
1304 __ TailCallRuntime(Runtime::kThrowStackOverflow); | 1304 __ TailCallRuntime(Runtime::kThrowStackOverflow); |
1305 __ Unreachable(); | 1305 __ Unreachable(); |
1306 } | 1306 } |
1307 } | 1307 } |
1308 | 1308 |
1309 void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) { | 1309 static void Generate_InterpreterEnterBytecode(MacroAssembler* masm) { |
1310 // Set the return address to the correct point in the interpreter entry | 1310 // Set the return address to the correct point in the interpreter entry |
1311 // trampoline. | 1311 // trampoline. |
1312 Smi* interpreter_entry_return_pc_offset( | 1312 Smi* interpreter_entry_return_pc_offset( |
1313 masm->isolate()->heap()->interpreter_entry_return_pc_offset()); | 1313 masm->isolate()->heap()->interpreter_entry_return_pc_offset()); |
1314 DCHECK_NE(interpreter_entry_return_pc_offset, Smi::kZero); | 1314 DCHECK_NE(interpreter_entry_return_pc_offset, Smi::kZero); |
1315 __ LoadObject(x1, masm->isolate()->builtins()->InterpreterEntryTrampoline()); | 1315 __ LoadObject(x1, masm->isolate()->builtins()->InterpreterEntryTrampoline()); |
1316 __ Add(lr, x1, Operand(interpreter_entry_return_pc_offset->value() + | 1316 __ Add(lr, x1, Operand(interpreter_entry_return_pc_offset->value() + |
1317 Code::kHeaderSize - kHeapObjectTag)); | 1317 Code::kHeaderSize - kHeapObjectTag)); |
1318 | 1318 |
1319 // Initialize the dispatch table register. | 1319 // Initialize the dispatch table register. |
(...skipping 20 matching lines...) Expand all Loading... |
1340 __ SmiUntag(kInterpreterBytecodeOffsetRegister); | 1340 __ SmiUntag(kInterpreterBytecodeOffsetRegister); |
1341 | 1341 |
1342 // Dispatch to the target bytecode. | 1342 // Dispatch to the target bytecode. |
1343 __ Ldrb(x1, MemOperand(kInterpreterBytecodeArrayRegister, | 1343 __ Ldrb(x1, MemOperand(kInterpreterBytecodeArrayRegister, |
1344 kInterpreterBytecodeOffsetRegister)); | 1344 kInterpreterBytecodeOffsetRegister)); |
1345 __ Mov(x1, Operand(x1, LSL, kPointerSizeLog2)); | 1345 __ Mov(x1, Operand(x1, LSL, kPointerSizeLog2)); |
1346 __ Ldr(ip0, MemOperand(kInterpreterDispatchTableRegister, x1)); | 1346 __ Ldr(ip0, MemOperand(kInterpreterDispatchTableRegister, x1)); |
1347 __ Jump(ip0); | 1347 __ Jump(ip0); |
1348 } | 1348 } |
1349 | 1349 |
| 1350 void Builtins::Generate_InterpreterEnterBytecodeAdvance(MacroAssembler* masm) { |
| 1351 // Advance the current bytecode offset stored within the given interpreter |
| 1352 // stack frame. This simulates what all bytecode handlers do upon completion |
| 1353 // of the underlying operation. |
| 1354 __ Ldr(x1, MemOperand(fp, InterpreterFrameConstants::kBytecodeArrayFromFp)); |
| 1355 __ Ldr(x2, MemOperand(fp, InterpreterFrameConstants::kBytecodeOffsetFromFp)); |
| 1356 __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 1357 { |
| 1358 FrameScope scope(masm, StackFrame::INTERNAL); |
| 1359 __ Push(kInterpreterAccumulatorRegister, x1, x2); |
| 1360 __ CallRuntime(Runtime::kInterpreterAdvanceBytecodeOffset); |
| 1361 __ Mov(x2, x0); // Result is the new bytecode offset. |
| 1362 __ Pop(kInterpreterAccumulatorRegister); |
| 1363 } |
| 1364 __ Str(x2, MemOperand(fp, InterpreterFrameConstants::kBytecodeOffsetFromFp)); |
| 1365 |
| 1366 Generate_InterpreterEnterBytecode(masm); |
| 1367 } |
| 1368 |
| 1369 void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) { |
| 1370 Generate_InterpreterEnterBytecode(masm); |
| 1371 } |
| 1372 |
1350 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { | 1373 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { |
1351 // ----------- S t a t e ------------- | 1374 // ----------- S t a t e ------------- |
1352 // -- x0 : argument count (preserved for callee) | 1375 // -- x0 : argument count (preserved for callee) |
1353 // -- x3 : new target (preserved for callee) | 1376 // -- x3 : new target (preserved for callee) |
1354 // -- x1 : target function (preserved for callee) | 1377 // -- x1 : target function (preserved for callee) |
1355 // ----------------------------------- | 1378 // ----------------------------------- |
1356 // First lookup code, maybe we don't need to compile! | 1379 // First lookup code, maybe we don't need to compile! |
1357 Label gotta_call_runtime; | 1380 Label gotta_call_runtime; |
1358 Label try_shared; | 1381 Label try_shared; |
1359 Label loop_top, loop_bottom; | 1382 Label loop_top, loop_bottom; |
(...skipping 1626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2986 __ Unreachable(); | 3009 __ Unreachable(); |
2987 } | 3010 } |
2988 } | 3011 } |
2989 | 3012 |
2990 #undef __ | 3013 #undef __ |
2991 | 3014 |
2992 } // namespace internal | 3015 } // namespace internal |
2993 } // namespace v8 | 3016 } // namespace v8 |
2994 | 3017 |
2995 #endif // V8_TARGET_ARCH_ARM | 3018 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |