| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
| 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 1306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1317 __ TailCallStub(&stub); | 1317 __ TailCallStub(&stub); |
| 1318 | 1318 |
| 1319 __ bind(&stack_overflow); | 1319 __ bind(&stack_overflow); |
| 1320 { | 1320 { |
| 1321 __ TailCallRuntime(Runtime::kThrowStackOverflow); | 1321 __ TailCallRuntime(Runtime::kThrowStackOverflow); |
| 1322 // Unreachable code. | 1322 // Unreachable code. |
| 1323 __ bkpt(0); | 1323 __ bkpt(0); |
| 1324 } | 1324 } |
| 1325 } | 1325 } |
| 1326 | 1326 |
| 1327 void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) { | 1327 static void Generate_InterpreterEnterBytecode(MacroAssembler* masm) { |
| 1328 // Set the return address to the correct point in the interpreter entry | 1328 // Set the return address to the correct point in the interpreter entry |
| 1329 // trampoline. | 1329 // trampoline. |
| 1330 Smi* interpreter_entry_return_pc_offset( | 1330 Smi* interpreter_entry_return_pc_offset( |
| 1331 masm->isolate()->heap()->interpreter_entry_return_pc_offset()); | 1331 masm->isolate()->heap()->interpreter_entry_return_pc_offset()); |
| 1332 DCHECK_NE(interpreter_entry_return_pc_offset, Smi::kZero); | 1332 DCHECK_NE(interpreter_entry_return_pc_offset, Smi::kZero); |
| 1333 __ Move(r5, masm->isolate()->builtins()->InterpreterEntryTrampoline()); | 1333 __ Move(r5, masm->isolate()->builtins()->InterpreterEntryTrampoline()); |
| 1334 __ addi(r0, r5, Operand(interpreter_entry_return_pc_offset->value() + | 1334 __ addi(r0, r5, Operand(interpreter_entry_return_pc_offset->value() + |
| 1335 Code::kHeaderSize - kHeapObjectTag)); | 1335 Code::kHeaderSize - kHeapObjectTag)); |
| 1336 __ mtlr(r0); | 1336 __ mtlr(r0); |
| 1337 | 1337 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 1359 __ SmiUntag(kInterpreterBytecodeOffsetRegister); | 1359 __ SmiUntag(kInterpreterBytecodeOffsetRegister); |
| 1360 | 1360 |
| 1361 // Dispatch to the target bytecode. | 1361 // Dispatch to the target bytecode. |
| 1362 __ lbzx(r4, MemOperand(kInterpreterBytecodeArrayRegister, | 1362 __ lbzx(r4, MemOperand(kInterpreterBytecodeArrayRegister, |
| 1363 kInterpreterBytecodeOffsetRegister)); | 1363 kInterpreterBytecodeOffsetRegister)); |
| 1364 __ ShiftLeftImm(ip, r4, Operand(kPointerSizeLog2)); | 1364 __ ShiftLeftImm(ip, r4, Operand(kPointerSizeLog2)); |
| 1365 __ LoadPX(ip, MemOperand(kInterpreterDispatchTableRegister, ip)); | 1365 __ LoadPX(ip, MemOperand(kInterpreterDispatchTableRegister, ip)); |
| 1366 __ Jump(ip); | 1366 __ Jump(ip); |
| 1367 } | 1367 } |
| 1368 | 1368 |
| 1369 void Builtins::Generate_InterpreterEnterBytecodeAdvance(MacroAssembler* masm) { |
| 1370 // Advance the current bytecode offset stored within the given interpreter |
| 1371 // stack frame. This simulates what all bytecode handlers do upon completion |
| 1372 // of the underlying operation. |
| 1373 __ LoadP(r4, MemOperand(fp, InterpreterFrameConstants::kBytecodeArrayFromFp)); |
| 1374 __ LoadP(r5, |
| 1375 MemOperand(fp, InterpreterFrameConstants::kBytecodeOffsetFromFp)); |
| 1376 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 1377 { |
| 1378 FrameScope scope(masm, StackFrame::INTERNAL); |
| 1379 __ Push(kInterpreterAccumulatorRegister, r4, r5); |
| 1380 __ CallRuntime(Runtime::kInterpreterAdvanceBytecodeOffset); |
| 1381 __ Move(r5, r3); // Result is the new bytecode offset. |
| 1382 __ Pop(kInterpreterAccumulatorRegister); |
| 1383 } |
| 1384 __ StoreP(r5, |
| 1385 MemOperand(fp, InterpreterFrameConstants::kBytecodeOffsetFromFp)); |
| 1386 |
| 1387 Generate_InterpreterEnterBytecode(masm); |
| 1388 } |
| 1389 |
| 1390 void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) { |
| 1391 Generate_InterpreterEnterBytecode(masm); |
| 1392 } |
| 1393 |
| 1369 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { | 1394 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { |
| 1370 // ----------- S t a t e ------------- | 1395 // ----------- S t a t e ------------- |
| 1371 // -- r3 : argument count (preserved for callee) | 1396 // -- r3 : argument count (preserved for callee) |
| 1372 // -- r6 : new target (preserved for callee) | 1397 // -- r6 : new target (preserved for callee) |
| 1373 // -- r4 : target function (preserved for callee) | 1398 // -- r4 : target function (preserved for callee) |
| 1374 // ----------------------------------- | 1399 // ----------------------------------- |
| 1375 // First lookup code, maybe we don't need to compile! | 1400 // First lookup code, maybe we don't need to compile! |
| 1376 Label gotta_call_runtime; | 1401 Label gotta_call_runtime; |
| 1377 Label try_shared; | 1402 Label try_shared; |
| 1378 Label loop_top, loop_bottom; | 1403 Label loop_top, loop_bottom; |
| (...skipping 1597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2976 __ CallRuntime(Runtime::kThrowStackOverflow); | 3001 __ CallRuntime(Runtime::kThrowStackOverflow); |
| 2977 __ bkpt(0); | 3002 __ bkpt(0); |
| 2978 } | 3003 } |
| 2979 } | 3004 } |
| 2980 | 3005 |
| 2981 #undef __ | 3006 #undef __ |
| 2982 } // namespace internal | 3007 } // namespace internal |
| 2983 } // namespace v8 | 3008 } // namespace v8 |
| 2984 | 3009 |
| 2985 #endif // V8_TARGET_ARCH_PPC | 3010 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |