Commit a5467aae authored by bjaideep's avatar bjaideep Committed by Commit bot

PPC/s390: [turbofan] Advance bytecode offset after lazy deopt.

Port 93c65952

Original commit message:

    This changes {FrameState} nodes modeling "after" states to use bytecode
    offsets pointing to the deoptimizing bytecode. This is in sync with the
    normal execution, as the bytecode offset is advanced after operations
    complete in regular bytecode handlers.

    The change is necessary to ensure lazy deoptimized frames contain an
    accurate bytecode offset while they are on the stack. Such frames can be
    inspected by various stack walks. The continuation builtin will advance
    the bytecode offset upon return.

R=mstarzinger@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=
LOG=N

Review-Url: https://codereview.chromium.org/2486393005
Cr-Commit-Position: refs/heads/master@{#40898}
parent 25d2268e
......@@ -1324,7 +1324,7 @@ void Builtins::Generate_InterpreterPushArgsAndConstructArray(
}
}
void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) {
static void Generate_InterpreterEnterBytecode(MacroAssembler* masm) {
// Set the return address to the correct point in the interpreter entry
// trampoline.
Smi* interpreter_entry_return_pc_offset(
......@@ -1366,6 +1366,31 @@ void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) {
__ Jump(ip);
}
void Builtins::Generate_InterpreterEnterBytecodeAdvance(MacroAssembler* masm) {
// Advance the current bytecode offset stored within the given interpreter
// stack frame. This simulates what all bytecode handlers do upon completion
// of the underlying operation.
__ LoadP(r4, MemOperand(fp, InterpreterFrameConstants::kBytecodeArrayFromFp));
__ LoadP(r5,
MemOperand(fp, InterpreterFrameConstants::kBytecodeOffsetFromFp));
__ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
{
FrameScope scope(masm, StackFrame::INTERNAL);
__ Push(kInterpreterAccumulatorRegister, r4, r5);
__ CallRuntime(Runtime::kInterpreterAdvanceBytecodeOffset);
__ Move(r5, r3); // Result is the new bytecode offset.
__ Pop(kInterpreterAccumulatorRegister);
}
__ StoreP(r5,
MemOperand(fp, InterpreterFrameConstants::kBytecodeOffsetFromFp));
Generate_InterpreterEnterBytecode(masm);
}
void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) {
Generate_InterpreterEnterBytecode(masm);
}
void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- r3 : argument count (preserved for callee)
......
......@@ -1328,7 +1328,7 @@ void Builtins::Generate_InterpreterPushArgsAndConstructArray(
}
}
void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) {
static void Generate_InterpreterEnterBytecode(MacroAssembler* masm) {
// Set the return address to the correct point in the interpreter entry
// trampoline.
Smi* interpreter_entry_return_pc_offset(
......@@ -1369,6 +1369,31 @@ void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) {
__ Jump(ip);
}
void Builtins::Generate_InterpreterEnterBytecodeAdvance(MacroAssembler* masm) {
// Advance the current bytecode offset stored within the given interpreter
// stack frame. This simulates what all bytecode handlers do upon completion
// of the underlying operation.
__ LoadP(r3, MemOperand(fp, InterpreterFrameConstants::kBytecodeArrayFromFp));
__ LoadP(r4,
MemOperand(fp, InterpreterFrameConstants::kBytecodeOffsetFromFp));
__ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
{
FrameScope scope(masm, StackFrame::INTERNAL);
__ Push(kInterpreterAccumulatorRegister, r3, r4);
__ CallRuntime(Runtime::kInterpreterAdvanceBytecodeOffset);
__ Move(r4, r2); // Result is the new bytecode offset.
__ Pop(kInterpreterAccumulatorRegister);
}
__ StoreP(r4,
MemOperand(fp, InterpreterFrameConstants::kBytecodeOffsetFromFp));
Generate_InterpreterEnterBytecode(masm);
}
void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) {
Generate_InterpreterEnterBytecode(masm);
}
void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- r2 : argument count (preserved for callee)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment