Commit 36c63513 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

Reland of [turbofan] Implicitly emit eager checkpoint at graph building....

Reland of [turbofan] Implicitly emit eager checkpoint at graph building. (patchset #1 id:1 of https://codereview.chromium.org/2104973004/ )

Reason for revert:
Can be cleanly relanded without any changes after a fix to redundancy elimination. Kudos go to Benedikt.

Depends on: https://codereview.chromium.org/2112463002/

Original issue's description:
> Revert of [turbofan] Implicitly emit eager checkpoint at graph building. (patchset #13 id:260001 of https://codereview.chromium.org/2074703002/ )
>
> Reason for revert:
> Causers flaky failures on the waterfall on Mac with the following error in the builtin QuickSort method:
>
> #
> # Fatal error in Zone
> # Allocation failed - process out of memory
> #
>
> Original issue's description:
> > [turbofan] Implicitly emit eager checkpoint at graph building.
> >
> > This makes preparation of eager checkpoints within the graph builder
> > implicit. Every sub-expression visitation is now guaranteed to emit
> > valid checkpoints in AstContext.
> >
> > R=jarin@chromium.org
> > BUG=v8:5021
> >
> > Committed: https://crrev.com/74e328efee7995aeee6d568f9d14f9bbc1087100
> > Cr-Commit-Position: refs/heads/master@{#37368}
>
> TBR=jarin@chromium.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=v8:5021
>
> Committed: https://crrev.com/45190a4fbfa5199f6ddf5ed9a7e2f50be865e0db
> Cr-Commit-Position: refs/heads/master@{#37372}

TBR=jarin@chromium.org
BUG=v8:5021

Review-Url: https://codereview.chromium.org/2107163002
Cr-Commit-Position: refs/heads/master@{#37395}
parent 5927deaa
This diff is collapsed.
......@@ -445,8 +445,7 @@ class AstGraphBuilder : public AstVisitor {
// Dispatched from VisitForInStatement.
void VisitForInAssignment(Expression* expr, Node* value,
const VectorSlotPair& feedback,
BailoutId bailout_id_before,
BailoutId bailout_id_after);
BailoutId bailout_id);
// Dispatched from VisitObjectLiteral.
void VisitObjectLiteralAccessor(Node* home_object,
......
......@@ -30,14 +30,39 @@ bool IsRedundantCheckpoint(Node* node) {
} // namespace
Reduction CheckpointElimination::Reduce(Node* node) {
if (node->opcode() != IrOpcode::kCheckpoint) return NoChange();
Reduction CheckpointElimination::ReduceCheckpoint(Node* node) {
DCHECK_EQ(IrOpcode::kCheckpoint, node->opcode());
if (IsRedundantCheckpoint(node)) {
return Replace(NodeProperties::GetEffectInput(node));
}
return NoChange();
}
Reduction CheckpointElimination::ReduceReturn(Node* node) {
DCHECK_EQ(IrOpcode::kReturn, node->opcode());
Node* effect = NodeProperties::GetEffectInput(node);
if (effect->opcode() == IrOpcode::kCheckpoint && effect->OwnedBy(node)) {
// Any checkpoint that is wholly owned by a {Return} node can never be used
// for an actual bailout and can hence be cut out of the effect chain.
Node* replacement = NodeProperties::GetEffectInput(effect);
NodeProperties::ReplaceEffectInput(node, replacement);
return Changed(node);
}
return NoChange();
}
Reduction CheckpointElimination::Reduce(Node* node) {
switch (node->opcode()) {
case IrOpcode::kCheckpoint:
return ReduceCheckpoint(node);
case IrOpcode::kReturn:
return ReduceReturn(node);
default:
break;
}
return NoChange();
}
} // namespace compiler
} // namespace internal
} // namespace v8
......@@ -18,6 +18,10 @@ class CheckpointElimination final : public AdvancedReducer {
~CheckpointElimination() final {}
Reduction Reduce(Node* node) final;
private:
Reduction ReduceCheckpoint(Node* node);
Reduction ReduceReturn(Node* node);
};
} // namespace compiler
......
......@@ -875,7 +875,7 @@ void FullCodeGenerator::VisitDoExpression(DoExpression* expr) {
Comment cmnt(masm_, "[ Do Expression");
SetExpressionPosition(expr);
VisitBlock(expr->block());
EmitVariableLoad(expr->result());
VisitInDuplicateContext(expr->result());
}
......
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