| 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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
| 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 1270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1281 __ TailCallStub(&stub); | 1281 __ TailCallStub(&stub); |
| 1282 | 1282 |
| 1283 __ bind(&stack_overflow); | 1283 __ bind(&stack_overflow); |
| 1284 { | 1284 { |
| 1285 __ TailCallRuntime(Runtime::kThrowStackOverflow); | 1285 __ TailCallRuntime(Runtime::kThrowStackOverflow); |
| 1286 // Unreachable code. | 1286 // Unreachable code. |
| 1287 __ break_(0xCC); | 1287 __ break_(0xCC); |
| 1288 } | 1288 } |
| 1289 } | 1289 } |
| 1290 | 1290 |
| 1291 void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) { | 1291 static void Generate_InterpreterEnterBytecode(MacroAssembler* masm) { |
| 1292 // Set the return address to the correct point in the interpreter entry | 1292 // Set the return address to the correct point in the interpreter entry |
| 1293 // trampoline. | 1293 // trampoline. |
| 1294 Smi* interpreter_entry_return_pc_offset( | 1294 Smi* interpreter_entry_return_pc_offset( |
| 1295 masm->isolate()->heap()->interpreter_entry_return_pc_offset()); | 1295 masm->isolate()->heap()->interpreter_entry_return_pc_offset()); |
| 1296 DCHECK_NE(interpreter_entry_return_pc_offset, Smi::kZero); | 1296 DCHECK_NE(interpreter_entry_return_pc_offset, Smi::kZero); |
| 1297 __ li(t0, Operand(masm->isolate()->builtins()->InterpreterEntryTrampoline())); | 1297 __ li(t0, Operand(masm->isolate()->builtins()->InterpreterEntryTrampoline())); |
| 1298 __ Daddu(ra, t0, Operand(interpreter_entry_return_pc_offset->value() + | 1298 __ Daddu(ra, t0, Operand(interpreter_entry_return_pc_offset->value() + |
| 1299 Code::kHeaderSize - kHeapObjectTag)); | 1299 Code::kHeaderSize - kHeapObjectTag)); |
| 1300 | 1300 |
| 1301 // Initialize the dispatch table register. | 1301 // Initialize the dispatch table register. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1324 | 1324 |
| 1325 // Dispatch to the target bytecode. | 1325 // Dispatch to the target bytecode. |
| 1326 __ Daddu(a1, kInterpreterBytecodeArrayRegister, | 1326 __ Daddu(a1, kInterpreterBytecodeArrayRegister, |
| 1327 kInterpreterBytecodeOffsetRegister); | 1327 kInterpreterBytecodeOffsetRegister); |
| 1328 __ lbu(a1, MemOperand(a1)); | 1328 __ lbu(a1, MemOperand(a1)); |
| 1329 __ Dlsa(a1, kInterpreterDispatchTableRegister, a1, kPointerSizeLog2); | 1329 __ Dlsa(a1, kInterpreterDispatchTableRegister, a1, kPointerSizeLog2); |
| 1330 __ ld(a1, MemOperand(a1)); | 1330 __ ld(a1, MemOperand(a1)); |
| 1331 __ Jump(a1); | 1331 __ Jump(a1); |
| 1332 } | 1332 } |
| 1333 | 1333 |
| 1334 void Builtins::Generate_InterpreterEnterBytecodeAdvance(MacroAssembler* masm) { |
| 1335 // Advance the current bytecode offset stored within the given interpreter |
| 1336 // stack frame. This simulates what all bytecode handlers do upon completion |
| 1337 // of the underlying operation. |
| 1338 __ ld(a1, MemOperand(fp, InterpreterFrameConstants::kBytecodeArrayFromFp)); |
| 1339 __ ld(a2, MemOperand(fp, InterpreterFrameConstants::kBytecodeOffsetFromFp)); |
| 1340 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 1341 { |
| 1342 FrameScope scope(masm, StackFrame::INTERNAL); |
| 1343 __ Push(kInterpreterAccumulatorRegister, a1, a2); |
| 1344 __ CallRuntime(Runtime::kInterpreterAdvanceBytecodeOffset); |
| 1345 __ mov(a2, v0); // Result is the new bytecode offset. |
| 1346 __ Pop(kInterpreterAccumulatorRegister); |
| 1347 } |
| 1348 __ sd(a2, MemOperand(fp, InterpreterFrameConstants::kBytecodeOffsetFromFp)); |
| 1349 |
| 1350 Generate_InterpreterEnterBytecode(masm); |
| 1351 } |
| 1352 |
| 1353 void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) { |
| 1354 Generate_InterpreterEnterBytecode(masm); |
| 1355 } |
| 1356 |
| 1334 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { | 1357 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { |
| 1335 // ----------- S t a t e ------------- | 1358 // ----------- S t a t e ------------- |
| 1336 // -- a0 : argument count (preserved for callee) | 1359 // -- a0 : argument count (preserved for callee) |
| 1337 // -- a3 : new target (preserved for callee) | 1360 // -- a3 : new target (preserved for callee) |
| 1338 // -- a1 : target function (preserved for callee) | 1361 // -- a1 : target function (preserved for callee) |
| 1339 // ----------------------------------- | 1362 // ----------------------------------- |
| 1340 // First lookup code, maybe we don't need to compile! | 1363 // First lookup code, maybe we don't need to compile! |
| 1341 Label gotta_call_runtime, gotta_call_runtime_no_stack; | 1364 Label gotta_call_runtime, gotta_call_runtime_no_stack; |
| 1342 Label try_shared; | 1365 Label try_shared; |
| 1343 Label loop_top, loop_bottom; | 1366 Label loop_top, loop_bottom; |
| (...skipping 1614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2958 __ break_(0xCC); | 2981 __ break_(0xCC); |
| 2959 } | 2982 } |
| 2960 } | 2983 } |
| 2961 | 2984 |
| 2962 #undef __ | 2985 #undef __ |
| 2963 | 2986 |
| 2964 } // namespace internal | 2987 } // namespace internal |
| 2965 } // namespace v8 | 2988 } // namespace v8 |
| 2966 | 2989 |
| 2967 #endif // V8_TARGET_ARCH_MIPS64 | 2990 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |