Commit 67c0ad3b authored by Milad Fa's avatar Milad Fa Committed by V8 LUCI CQ

PPC/s390: [sparkplug] Allow sparkplug->ignition deopt in func entry

Port af62c4f0

Original Commit Message:

    Adapted from https://crrev.com/c/3862264.

    Add a new teardown trampoline for the case where a Sparkplug function is
    deoptimized during its function entry stack check. In these cases, the
    stack is in an incomplete setup state, so instead of forwarding to
    interpreter re-entry, we undo the partial stack setup and forward to
    the standard interpreter entry.

R=szuend@chromium.org, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com
BUG=
LOG=N

Change-Id: I6e3b906938dc9a297b602290e762426e56fb8d9d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3864189Reviewed-by: 's avatarJunliang Yan <junyan@redhat.com>
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#82828}
parent 1e3e6969
...@@ -1321,6 +1321,26 @@ void Builtins::Generate_BaselineOutOfLinePrologue(MacroAssembler* masm) { ...@@ -1321,6 +1321,26 @@ void Builtins::Generate_BaselineOutOfLinePrologue(MacroAssembler* masm) {
} }
#endif #endif
// static
void Builtins::Generate_BaselineOutOfLinePrologueDeopt(MacroAssembler* masm) {
// We're here because we got deopted during BaselineOutOfLinePrologue's stack
// check. Undo all its frame creation and call into the interpreter instead.
// Drop bytecode offset (was the feedback vector but got replaced during
// deopt) and bytecode array.
__ Drop(2);
// Context, closure, argc.
__ Pop(kContextRegister, kJavaScriptCallTargetRegister,
kJavaScriptCallArgCountRegister);
// Drop frame pointer
__ LeaveFrame(StackFrame::BASELINE);
// Enter the interpreter.
__ TailCallBuiltin(Builtin::kInterpreterEntryTrampoline);
}
// Generate code for entering a JS function with the interpreter. // Generate code for entering a JS function with the interpreter.
// On entry to the function the receiver and arguments have been pushed on the // On entry to the function the receiver and arguments have been pushed on the
// stack left to right. // stack left to right.
......
...@@ -1358,6 +1358,26 @@ void Builtins::Generate_BaselineOutOfLinePrologue(MacroAssembler* masm) { ...@@ -1358,6 +1358,26 @@ void Builtins::Generate_BaselineOutOfLinePrologue(MacroAssembler* masm) {
} }
#endif #endif
// static
void Builtins::Generate_BaselineOutOfLinePrologueDeopt(MacroAssembler* masm) {
// We're here because we got deopted during BaselineOutOfLinePrologue's stack
// check. Undo all its frame creation and call into the interpreter instead.
// Drop bytecode offset (was the feedback vector but got replaced during
// deopt) and bytecode array.
__ Drop(2);
// Context, closure, argc.
__ Pop(kContextRegister, kJavaScriptCallTargetRegister,
kJavaScriptCallArgCountRegister);
// Drop frame pointer
__ LeaveFrame(StackFrame::BASELINE);
// Enter the interpreter.
__ TailCallBuiltin(Builtin::kInterpreterEntryTrampoline);
}
// Generate code for entering a JS function with the interpreter. // Generate code for entering a JS function with the interpreter.
// On entry to the function the receiver and arguments have been pushed on the // On entry to the function the receiver and arguments have been pushed on the
// stack left to right. // stack left to right.
......
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