Commit a4afba53 authored by ssanfilippo's avatar ssanfilippo Committed by Commit bot

[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}
parent 731ebc0e
......@@ -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) {
......
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