Commit f42870ae authored by Jakob Gruber's avatar Jakob Gruber Committed by Commit Bot

[compiler] Support non-branch continuations for StackPointerGreaterThan

We previously had a DCHECK to protect the assumption that the
continuation to StackPointerGreaterThan must be a branch. This is not
a valid assumption to make, in fact the second callsite of
VisitStackPointerGreaterThan immediately violates it.

Instead, this CL additionally considers non-branch continuations when
getting the effect level.

A slight digression since it was not clear to me how comparison
results were materialized for 'Set' continuations: this happens during
codegen, where CodeGenerator::AssembleInstruction inserts a call to
AssembleArchBoolean if necessary.

Bug: v8:9829,v8:9534
Change-Id: Ib554071b7aa33e0f6b8a0d605219db6b6dc7d5b0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1871912Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64430}
parent a927810c
......@@ -580,9 +580,11 @@ void InstructionSelector::VisitStackPointerGreaterThan(
Node* const value = node->InputAt(0);
InstructionCode opcode = kArchStackPointerGreaterThan;
DCHECK(cont->IsBranch());
const int effect_level =
GetEffectLevel(cont->true_block()->PredecessorAt(0)->control_input());
int effect_level = GetEffectLevel(node);
if (cont->IsBranch()) {
effect_level =
GetEffectLevel(cont->true_block()->PredecessorAt(0)->control_input());
}
IA32OperandGenerator g(this);
if (g.CanBeMemoryOperand(kIA32Cmp, node, value, effect_level)) {
......
......@@ -548,9 +548,11 @@ void InstructionSelector::VisitStackPointerGreaterThan(
Node* const value = node->InputAt(0);
InstructionCode opcode = kArchStackPointerGreaterThan;
DCHECK(cont->IsBranch());
const int effect_level =
GetEffectLevel(cont->true_block()->PredecessorAt(0)->control_input());
int effect_level = GetEffectLevel(node);
if (cont->IsBranch()) {
effect_level =
GetEffectLevel(cont->true_block()->PredecessorAt(0)->control_input());
}
X64OperandGenerator g(this);
if (g.CanBeMemoryOperand(kX64Cmp, node, value, effect_level)) {
......
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