Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1611)

Unified Diff: src/compiler/checkpoint-elimination.cc

Issue 2107163002: Reland of [turbofan] Implicitly emit eager checkpoint at graph building. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_turbofan-checkpoint-graph-builder-4
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/checkpoint-elimination.h ('k') | src/full-codegen/full-codegen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/checkpoint-elimination.cc
diff --git a/src/compiler/checkpoint-elimination.cc b/src/compiler/checkpoint-elimination.cc
index d81e1096820fbfba966ba1b34f6ee12bd8cac358..ce1a86105671088a2e0e9ec82dcad6a3573ca2a5 100644
--- a/src/compiler/checkpoint-elimination.cc
+++ b/src/compiler/checkpoint-elimination.cc
@@ -30,10 +30,35 @@
} // 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();
}
« no previous file with comments | « src/compiler/checkpoint-elimination.h ('k') | src/full-codegen/full-codegen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698