[Interpreter] Fix incorrect tail call code generated when using Abort.
Previous to this change, the dummy Return inside InterpreterAssembler::Abort caused TurboFan to emit incorrect code for handlers that made use of this call. The stack pointer would not be incremented before tail calling into the next handler, causing it to push on top on the caller's frame instead of overwriting it. BUG=v8:4280 LOG=N Review URL: https://codereview.chromium.org/1819853002 Cr-Commit-Position: refs/heads/master@{#34950}
This commit is contained in:
parent
731ebc0e99
commit
a4afba532a
@ -500,22 +500,24 @@ void InterpreterAssembler::StackCheck() {
|
||||
void InterpreterAssembler::Abort(BailoutReason bailout_reason) {
|
||||
disable_stack_check_across_call_ = true;
|
||||
Node* abort_id = SmiTag(Int32Constant(bailout_reason));
|
||||
Node* ret_value = CallRuntime(Runtime::kAbort, GetContext(), abort_id);
|
||||
CallRuntime(Runtime::kAbort, GetContext(), abort_id);
|
||||
disable_stack_check_across_call_ = false;
|
||||
// Unreached, but keeps turbofan happy.
|
||||
Return(ret_value);
|
||||
}
|
||||
|
||||
void InterpreterAssembler::AbortIfWordNotEqual(Node* lhs, Node* rhs,
|
||||
BailoutReason bailout_reason) {
|
||||
CodeStubAssembler::Label match(this);
|
||||
CodeStubAssembler::Label no_match(this);
|
||||
CodeStubAssembler::Label end(this);
|
||||
|
||||
Node* condition = WordEqual(lhs, rhs);
|
||||
Branch(condition, &match, &no_match);
|
||||
Bind(&no_match);
|
||||
Abort(bailout_reason);
|
||||
Goto(&end);
|
||||
Bind(&match);
|
||||
Goto(&end);
|
||||
Bind(&end);
|
||||
}
|
||||
|
||||
void InterpreterAssembler::TraceBytecode(Runtime::FunctionId function_id) {
|
||||
|
Loading…
Reference in New Issue
Block a user