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 { |
| 1355 FrameScope scope(masm, StackFrame::MANUAL); |
| 1356 __ Push(x0, x1, x3, fp, lr); |
| 1357 __ Ldr(x0, MemOperand(fp, InterpreterFrameConstants::kBytecodeArrayFromFp)); |
| 1358 __ Ldr(x1, |
| 1359 MemOperand(fp, InterpreterFrameConstants::kBytecodeOffsetFromFp)); |
| 1360 __ SmiUntag(x1); |
| 1361 __ CallCFunction( |
| 1362 ExternalReference::interpreter_advance_bytecode_offset(masm->isolate()), |
| 1363 2); |
| 1364 __ SmiTag(x0); |
| 1365 __ Str(x0, |
| 1366 MemOperand(fp, InterpreterFrameConstants::kBytecodeOffsetFromFp)); |
| 1367 __ Pop(lr, fp, x3, x1, x0); |
| 1368 } |
| 1369 |
| 1370 Generate_InterpreterEnterBytecode(masm); |
| 1371 } |
| 1372 |
| 1373 void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) { |
| 1374 Generate_InterpreterEnterBytecode(masm); |
| 1375 } |
| 1376 |
1350 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { | 1377 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { |
1351 // ----------- S t a t e ------------- | 1378 // ----------- S t a t e ------------- |
1352 // -- x0 : argument count (preserved for callee) | 1379 // -- x0 : argument count (preserved for callee) |
1353 // -- x3 : new target (preserved for callee) | 1380 // -- x3 : new target (preserved for callee) |
1354 // -- x1 : target function (preserved for callee) | 1381 // -- x1 : target function (preserved for callee) |
1355 // ----------------------------------- | 1382 // ----------------------------------- |
1356 // First lookup code, maybe we don't need to compile! | 1383 // First lookup code, maybe we don't need to compile! |
1357 Label gotta_call_runtime; | 1384 Label gotta_call_runtime; |
1358 Label try_shared; | 1385 Label try_shared; |
1359 Label loop_top, loop_bottom; | 1386 Label loop_top, loop_bottom; |
(...skipping 1626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2986 __ Unreachable(); | 3013 __ Unreachable(); |
2987 } | 3014 } |
2988 } | 3015 } |
2989 | 3016 |
2990 #undef __ | 3017 #undef __ |
2991 | 3018 |
2992 } // namespace internal | 3019 } // namespace internal |
2993 } // namespace v8 | 3020 } // namespace v8 |
2994 | 3021 |
2995 #endif // V8_TARGET_ARCH_ARM | 3022 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |