OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_ARM | 5 #if V8_TARGET_ARCH_ARM |
6 | 6 |
7 #include "src/codegen.h" | 7 #include "src/codegen.h" |
8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
(...skipping 1278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1289 __ TailCallStub(&stub); | 1289 __ TailCallStub(&stub); |
1290 | 1290 |
1291 __ bind(&stack_overflow); | 1291 __ bind(&stack_overflow); |
1292 { | 1292 { |
1293 __ TailCallRuntime(Runtime::kThrowStackOverflow); | 1293 __ TailCallRuntime(Runtime::kThrowStackOverflow); |
1294 // Unreachable code. | 1294 // Unreachable code. |
1295 __ bkpt(0); | 1295 __ bkpt(0); |
1296 } | 1296 } |
1297 } | 1297 } |
1298 | 1298 |
1299 void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) { | 1299 static void Generate_InterpreterEnterBytecode(MacroAssembler* masm) { |
1300 // Set the return address to the correct point in the interpreter entry | 1300 // Set the return address to the correct point in the interpreter entry |
1301 // trampoline. | 1301 // trampoline. |
1302 Smi* interpreter_entry_return_pc_offset( | 1302 Smi* interpreter_entry_return_pc_offset( |
1303 masm->isolate()->heap()->interpreter_entry_return_pc_offset()); | 1303 masm->isolate()->heap()->interpreter_entry_return_pc_offset()); |
1304 DCHECK_NE(interpreter_entry_return_pc_offset, Smi::kZero); | 1304 DCHECK_NE(interpreter_entry_return_pc_offset, Smi::kZero); |
1305 __ Move(r2, masm->isolate()->builtins()->InterpreterEntryTrampoline()); | 1305 __ Move(r2, masm->isolate()->builtins()->InterpreterEntryTrampoline()); |
1306 __ add(lr, r2, Operand(interpreter_entry_return_pc_offset->value() + | 1306 __ add(lr, r2, Operand(interpreter_entry_return_pc_offset->value() + |
1307 Code::kHeaderSize - kHeapObjectTag)); | 1307 Code::kHeaderSize - kHeapObjectTag)); |
1308 | 1308 |
1309 // Initialize the dispatch table register. | 1309 // Initialize the dispatch table register. |
(...skipping 20 matching lines...) Expand all Loading... | |
1330 __ SmiUntag(kInterpreterBytecodeOffsetRegister); | 1330 __ SmiUntag(kInterpreterBytecodeOffsetRegister); |
1331 | 1331 |
1332 // Dispatch to the target bytecode. | 1332 // Dispatch to the target bytecode. |
1333 __ ldrb(r1, MemOperand(kInterpreterBytecodeArrayRegister, | 1333 __ ldrb(r1, MemOperand(kInterpreterBytecodeArrayRegister, |
1334 kInterpreterBytecodeOffsetRegister)); | 1334 kInterpreterBytecodeOffsetRegister)); |
1335 __ ldr(ip, MemOperand(kInterpreterDispatchTableRegister, r1, LSL, | 1335 __ ldr(ip, MemOperand(kInterpreterDispatchTableRegister, r1, LSL, |
1336 kPointerSizeLog2)); | 1336 kPointerSizeLog2)); |
1337 __ mov(pc, ip); | 1337 __ mov(pc, ip); |
1338 } | 1338 } |
1339 | 1339 |
1340 void Builtins::Generate_InterpreterEnterBytecodeAdvance(MacroAssembler* masm) { | |
1341 // Advance the current bytecode offset stored within the given interpreter | |
1342 // stack frame. This simulates what all bytecode handlers do upon completion | |
1343 // of the underlying operation. | |
1344 { | |
1345 FrameScope scope(masm, StackFrame::MANUAL); | |
rmcilroy
2016/11/09 14:48:29
Any reason this couldn't be a standard runtime cal
Michael Starzinger
2016/11/10 10:09:40
Done.
| |
1346 __ stm(db_w, sp, kCallerSaved); | |
1347 __ PrepareCallCFunction(2, 0, r1); | |
1348 __ ldr(r0, MemOperand(fp, InterpreterFrameConstants::kBytecodeArrayFromFp)); | |
1349 __ ldr(r1, | |
1350 MemOperand(fp, InterpreterFrameConstants::kBytecodeOffsetFromFp)); | |
1351 __ SmiUntag(r1); | |
1352 __ CallCFunction( | |
1353 ExternalReference::interpreter_advance_bytecode_offset(masm->isolate()), | |
1354 2); | |
1355 __ SmiTag(r0); | |
1356 __ str(r0, | |
1357 MemOperand(fp, InterpreterFrameConstants::kBytecodeOffsetFromFp)); | |
1358 __ ldm(ia_w, sp, kCallerSaved); | |
1359 } | |
1360 | |
1361 Generate_InterpreterEnterBytecode(masm); | |
1362 } | |
1363 | |
1364 void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) { | |
1365 Generate_InterpreterEnterBytecode(masm); | |
1366 } | |
1367 | |
1340 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { | 1368 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { |
1341 // ----------- S t a t e ------------- | 1369 // ----------- S t a t e ------------- |
1342 // -- r0 : argument count (preserved for callee) | 1370 // -- r0 : argument count (preserved for callee) |
1343 // -- r3 : new target (preserved for callee) | 1371 // -- r3 : new target (preserved for callee) |
1344 // -- r1 : target function (preserved for callee) | 1372 // -- r1 : target function (preserved for callee) |
1345 // ----------------------------------- | 1373 // ----------------------------------- |
1346 // First lookup code, maybe we don't need to compile! | 1374 // First lookup code, maybe we don't need to compile! |
1347 Label gotta_call_runtime, gotta_call_runtime_no_stack; | 1375 Label gotta_call_runtime, gotta_call_runtime_no_stack; |
1348 Label try_shared; | 1376 Label try_shared; |
1349 Label loop_top, loop_bottom; | 1377 Label loop_top, loop_bottom; |
(...skipping 1537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2887 __ bkpt(0); | 2915 __ bkpt(0); |
2888 } | 2916 } |
2889 } | 2917 } |
2890 | 2918 |
2891 #undef __ | 2919 #undef __ |
2892 | 2920 |
2893 } // namespace internal | 2921 } // namespace internal |
2894 } // namespace v8 | 2922 } // namespace v8 |
2895 | 2923 |
2896 #endif // V8_TARGET_ARCH_ARM | 2924 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |