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

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

Issue 2761703002: [turbofan] Properly handle IfException projections on JSForInNext. (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | test/mjsunit/regress/regress-6121.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-typed-lowering.cc
diff --git a/src/compiler/js-typed-lowering.cc b/src/compiler/js-typed-lowering.cc
index a597eeb8173560b4b90d2a06e1b22167ba295692..34deb8e03cdcbb9cc1d86fa4c3355bf605346d1e 100644
--- a/src/compiler/js-typed-lowering.cc
+++ b/src/compiler/js-typed-lowering.cc
@@ -2199,11 +2199,23 @@ Reduction JSTypedLowering::ReduceJSForInNext(Node* node) {
vfalse0 = efalse0 = if_false0 = graph()->NewNode(
common()->Call(desc), jsgraph()->HeapConstant(callable.code()), key,
receiver, context, frame_state, effect, if_false0);
+
+ // Update potential {IfException} uses of {node} to point to the ahove
+ // ForInFilter stub call node instead.
+ Node* if_exception = nullptr;
+ if (NodeProperties::IsExceptionalCall(node, &if_exception)) {
+ if_false0 = graph()->NewNode(common()->IfSuccess(), vfalse0);
+ NodeProperties::ReplaceControlInput(if_exception, vfalse0);
+ NodeProperties::ReplaceEffectInput(if_exception, efalse0);
+ Revisit(if_exception);
+ }
}
control = graph()->NewNode(common()->Merge(2), if_true0, if_false0);
effect = graph()->NewNode(common()->EffectPhi(2), etrue0, efalse0, control);
ReplaceWithValue(node, node, effect, control);
+
+ // Morph the {node} into a Phi.
node->ReplaceInput(0, vtrue0);
node->ReplaceInput(1, vfalse0);
node->ReplaceInput(2, control);
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-6121.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698