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

Unified Diff: src/compiler/js-intrinsic-lowering.cc

Issue 1206533002: [turbofan] Run DeadCodeElimination together with the advanced reducers. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix test262 test failure Created 5 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/graph-reducer.cc ('k') | src/compiler/pipeline.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-intrinsic-lowering.cc
diff --git a/src/compiler/js-intrinsic-lowering.cc b/src/compiler/js-intrinsic-lowering.cc
index 1e3de48799bd2bf80f652bc3c06f1d35ff2a9c1d..f4a886f88ca41b915d5d37a562ebfac045af25be 100644
--- a/src/compiler/js-intrinsic-lowering.cc
+++ b/src/compiler/js-intrinsic-lowering.cc
@@ -132,31 +132,18 @@ Reduction JSIntrinsicLowering::ReduceDateField(Node* node) {
Reduction JSIntrinsicLowering::ReduceDeoptimizeNow(Node* node) {
if (mode() != kDeoptimizationEnabled) return NoChange();
- Node* frame_state = NodeProperties::GetFrameStateInput(node, 0);
- DCHECK_EQ(frame_state->opcode(), IrOpcode::kFrameState);
-
- Node* effect = NodeProperties::GetEffectInput(node);
- Node* control = NodeProperties::GetControlInput(node);
-
- // We are making the continuation after the call dead. To
- // model this, we generate if (true) statement with deopt
- // in the true branch and continuation in the false branch.
- Node* branch =
- graph()->NewNode(common()->Branch(), jsgraph()->TrueConstant(), control);
-
- // False branch - the original continuation.
- Node* if_false = graph()->NewNode(common()->IfFalse(), branch);
- ReplaceWithValue(node, jsgraph()->UndefinedConstant(), effect, if_false);
-
- // True branch: deopt.
- Node* if_true = graph()->NewNode(common()->IfTrue(), branch);
- Node* deopt =
- graph()->NewNode(common()->Deoptimize(), frame_state, effect, if_true);
+ Node* const frame_state = NodeProperties::GetFrameStateInput(node, 0);
+ Node* const effect = NodeProperties::GetEffectInput(node);
+ Node* const control = NodeProperties::GetControlInput(node);
- // Connect the deopt to the merge exiting the graph.
- NodeProperties::MergeControlToEnd(graph(), common(), deopt);
+ // TODO(bmeurer): Move MergeControlToEnd() to the AdvancedReducer.
+ Node* deoptimize =
+ graph()->NewNode(common()->Deoptimize(), frame_state, effect, control);
+ NodeProperties::MergeControlToEnd(graph(), common(), deoptimize);
- return Changed(deopt);
+ node->set_op(common()->Dead());
+ node->TrimInputCount(0);
+ return Changed(node);
}
« no previous file with comments | « src/compiler/graph-reducer.cc ('k') | src/compiler/pipeline.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698