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_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
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 __ break_(0xCC); | 1295 __ break_(0xCC); |
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 __ li(t0, Operand(masm->isolate()->builtins()->InterpreterEntryTrampoline())); | 1305 __ li(t0, Operand(masm->isolate()->builtins()->InterpreterEntryTrampoline())); |
1306 __ Addu(ra, t0, Operand(interpreter_entry_return_pc_offset->value() + | 1306 __ Addu(ra, t0, 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 22 matching lines...) Expand all Loading... |
1332 | 1332 |
1333 // Dispatch to the target bytecode. | 1333 // Dispatch to the target bytecode. |
1334 __ Addu(a1, kInterpreterBytecodeArrayRegister, | 1334 __ Addu(a1, kInterpreterBytecodeArrayRegister, |
1335 kInterpreterBytecodeOffsetRegister); | 1335 kInterpreterBytecodeOffsetRegister); |
1336 __ lbu(a1, MemOperand(a1)); | 1336 __ lbu(a1, MemOperand(a1)); |
1337 __ Lsa(a1, kInterpreterDispatchTableRegister, a1, kPointerSizeLog2); | 1337 __ Lsa(a1, kInterpreterDispatchTableRegister, a1, kPointerSizeLog2); |
1338 __ lw(a1, MemOperand(a1)); | 1338 __ lw(a1, MemOperand(a1)); |
1339 __ Jump(a1); | 1339 __ Jump(a1); |
1340 } | 1340 } |
1341 | 1341 |
| 1342 void Builtins::Generate_InterpreterEnterBytecodeAdvance(MacroAssembler* masm) { |
| 1343 // Advance the current bytecode offset stored within the given interpreter |
| 1344 // stack frame. This simulates what all bytecode handlers do upon completion |
| 1345 // of the underlying operation. |
| 1346 { |
| 1347 FrameScope scope(masm, StackFrame::MANUAL); |
| 1348 __ MultiPush(kJSCallerSaved | kCalleeSaved); |
| 1349 __ PrepareCallCFunction(2, 0, a1); |
| 1350 __ lw(a0, MemOperand(fp, InterpreterFrameConstants::kBytecodeArrayFromFp)); |
| 1351 __ lw(a1, MemOperand(fp, InterpreterFrameConstants::kBytecodeOffsetFromFp)); |
| 1352 __ SmiUntag(a1); |
| 1353 __ CallCFunction( |
| 1354 ExternalReference::interpreter_advance_bytecode_offset(masm->isolate()), |
| 1355 2); |
| 1356 __ SmiTag(v0); |
| 1357 __ sw(v0, MemOperand(fp, InterpreterFrameConstants::kBytecodeOffsetFromFp)); |
| 1358 __ MultiPop(kJSCallerSaved | kCalleeSaved); |
| 1359 } |
| 1360 |
| 1361 Generate_InterpreterEnterBytecode(masm); |
| 1362 } |
| 1363 |
| 1364 void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) { |
| 1365 Generate_InterpreterEnterBytecode(masm); |
| 1366 } |
| 1367 |
1342 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { | 1368 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { |
1343 // ----------- S t a t e ------------- | 1369 // ----------- S t a t e ------------- |
1344 // -- a0 : argument count (preserved for callee) | 1370 // -- a0 : argument count (preserved for callee) |
1345 // -- a3 : new target (preserved for callee) | 1371 // -- a3 : new target (preserved for callee) |
1346 // -- a1 : target function (preserved for callee) | 1372 // -- a1 : target function (preserved for callee) |
1347 // ----------------------------------- | 1373 // ----------------------------------- |
1348 // First lookup code, maybe we don't need to compile! | 1374 // First lookup code, maybe we don't need to compile! |
1349 Label gotta_call_runtime, gotta_call_runtime_no_stack; | 1375 Label gotta_call_runtime, gotta_call_runtime_no_stack; |
1350 Label try_shared; | 1376 Label try_shared; |
1351 Label loop_top, loop_bottom; | 1377 Label loop_top, loop_bottom; |
(...skipping 1611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2963 __ break_(0xCC); | 2989 __ break_(0xCC); |
2964 } | 2990 } |
2965 } | 2991 } |
2966 | 2992 |
2967 #undef __ | 2993 #undef __ |
2968 | 2994 |
2969 } // namespace internal | 2995 } // namespace internal |
2970 } // namespace v8 | 2996 } // namespace v8 |
2971 | 2997 |
2972 #endif // V8_TARGET_ARCH_MIPS | 2998 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |