PPC: [interpreter] First implementation of stack unwinding.
Port 0b3066b8f5
Original commit message:
This implements a first prototype of stack unwinding for interpreted
frames. The unwinding machinery performs a range-based lookup in the
given handler table and potentially continues dispatching at the handler
offset. Note that this does not yet correctly restore the context to the
correct value when the handler is being entered.
R=mstarzinger@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=v8:4674
LOG=n
Review URL: https://codereview.chromium.org/1612593002
Cr-Commit-Position: refs/heads/master@{#33418}
This commit is contained in:
parent
6fc3149939
commit
637cbeeb12
@ -1048,23 +1048,7 @@ void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) {
|
||||
}
|
||||
|
||||
|
||||
static void Generate_InterpreterNotifyDeoptimizedHelper(
|
||||
MacroAssembler* masm, Deoptimizer::BailoutType type) {
|
||||
// Enter an internal frame.
|
||||
{
|
||||
FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
|
||||
// Save accumulator register and pass the deoptimization type to
|
||||
// the runtime system.
|
||||
__ LoadSmiLiteral(r4, Smi::FromInt(static_cast<int>(type)));
|
||||
__ Push(kInterpreterAccumulatorRegister, r4);
|
||||
__ CallRuntime(Runtime::kNotifyDeoptimized);
|
||||
__ pop(kInterpreterAccumulatorRegister); // Restore accumulator register.
|
||||
// Tear down internal frame.
|
||||
}
|
||||
|
||||
// Drop state (we don't use these for interpreter deopts).
|
||||
__ Drop(1);
|
||||
|
||||
static void Generate_EnterBytecodeDispatch(MacroAssembler* masm) {
|
||||
// Initialize register file register and dispatch table register.
|
||||
__ addi(kInterpreterRegisterFileRegister, fp,
|
||||
Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp));
|
||||
@ -1114,6 +1098,28 @@ static void Generate_InterpreterNotifyDeoptimizedHelper(
|
||||
}
|
||||
|
||||
|
||||
static void Generate_InterpreterNotifyDeoptimizedHelper(
|
||||
MacroAssembler* masm, Deoptimizer::BailoutType type) {
|
||||
// Enter an internal frame.
|
||||
{
|
||||
FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
|
||||
// Save accumulator register and pass the deoptimization type to
|
||||
// the runtime system.
|
||||
__ LoadSmiLiteral(r4, Smi::FromInt(static_cast<int>(type)));
|
||||
__ Push(kInterpreterAccumulatorRegister, r4);
|
||||
__ CallRuntime(Runtime::kNotifyDeoptimized);
|
||||
__ pop(kInterpreterAccumulatorRegister); // Restore accumulator register.
|
||||
// Tear down internal frame.
|
||||
}
|
||||
|
||||
// Drop state (we don't use these for interpreter deopts).
|
||||
__ Drop(1);
|
||||
|
||||
// Enter the bytecode dispatch.
|
||||
Generate_EnterBytecodeDispatch(masm);
|
||||
}
|
||||
|
||||
|
||||
void Builtins::Generate_InterpreterNotifyDeoptimized(MacroAssembler* masm) {
|
||||
Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::EAGER);
|
||||
}
|
||||
@ -1129,6 +1135,11 @@ void Builtins::Generate_InterpreterNotifyLazyDeoptimized(MacroAssembler* masm) {
|
||||
}
|
||||
|
||||
|
||||
void Builtins::Generate_InterpreterEnterExceptionHandler(MacroAssembler* masm) {
|
||||
Generate_EnterBytecodeDispatch(masm);
|
||||
}
|
||||
|
||||
|
||||
void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
|
||||
CallRuntimePassFunction(masm, Runtime::kCompileLazy);
|
||||
GenerateTailCallToReturnedCode(masm);
|
||||
|
Loading…
Reference in New Issue
Block a user