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 __ ldr(r1, MemOperand(fp, InterpreterFrameConstants::kBytecodeArrayFromFp)); |
| 1345 __ ldr(r2, MemOperand(fp, InterpreterFrameConstants::kBytecodeOffsetFromFp)); |
| 1346 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 1347 { |
| 1348 FrameScope scope(masm, StackFrame::INTERNAL); |
| 1349 __ Push(kInterpreterAccumulatorRegister, r1, r2); |
| 1350 __ CallRuntime(Runtime::kInterpreterAdvanceBytecodeOffset); |
| 1351 __ mov(r2, r0); // Result is the new bytecode offset. |
| 1352 __ Pop(kInterpreterAccumulatorRegister); |
| 1353 } |
| 1354 __ str(r2, MemOperand(fp, InterpreterFrameConstants::kBytecodeOffsetFromFp)); |
| 1355 |
| 1356 Generate_InterpreterEnterBytecode(masm); |
| 1357 } |
| 1358 |
| 1359 void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) { |
| 1360 Generate_InterpreterEnterBytecode(masm); |
| 1361 } |
| 1362 |
1340 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { | 1363 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { |
1341 // ----------- S t a t e ------------- | 1364 // ----------- S t a t e ------------- |
1342 // -- r0 : argument count (preserved for callee) | 1365 // -- r0 : argument count (preserved for callee) |
1343 // -- r3 : new target (preserved for callee) | 1366 // -- r3 : new target (preserved for callee) |
1344 // -- r1 : target function (preserved for callee) | 1367 // -- r1 : target function (preserved for callee) |
1345 // ----------------------------------- | 1368 // ----------------------------------- |
1346 // First lookup code, maybe we don't need to compile! | 1369 // First lookup code, maybe we don't need to compile! |
1347 Label gotta_call_runtime, gotta_call_runtime_no_stack; | 1370 Label gotta_call_runtime, gotta_call_runtime_no_stack; |
1348 Label try_shared; | 1371 Label try_shared; |
1349 Label loop_top, loop_bottom; | 1372 Label loop_top, loop_bottom; |
(...skipping 1537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2887 __ bkpt(0); | 2910 __ bkpt(0); |
2888 } | 2911 } |
2889 } | 2912 } |
2890 | 2913 |
2891 #undef __ | 2914 #undef __ |
2892 | 2915 |
2893 } // namespace internal | 2916 } // namespace internal |
2894 } // namespace v8 | 2917 } // namespace v8 |
2895 | 2918 |
2896 #endif // V8_TARGET_ARCH_ARM | 2919 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |