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

Unified Diff: src/compiler/js-inlining.cc

Issue 2272633002: [turbofan] Fix constructor inlining control wiring. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Better comments. Created 4 years, 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-inlining.cc
diff --git a/src/compiler/js-inlining.cc b/src/compiler/js-inlining.cc
index 00a0eed26db580a889b1e85ec5d8a3cf9474a93e..4f1dc7c708fb0328bb39b12170a0c910353e1ea2 100644
--- a/src/compiler/js-inlining.cc
+++ b/src/compiler/js-inlining.cc
@@ -434,18 +434,21 @@ Reduction JSInliner::ReduceJSCall(Node* node, Handle<JSFunction> function) {
frame_state_before, effect);
NodeProperties::ReplaceEffectInput(node, create);
// Insert a check of the return value to determine whether the return
- // value
- // or the implicit receiver should be selected as a result of the call.
+ // value or the implicit receiver should be selected as a result of the
+ // call. The check is wired into the successful control completion.
+ Node* success = graph()->NewNode(common()->IfSuccess(), node);
Node* check = graph()->NewNode(
javascript()->CallRuntime(Runtime::kInlineIsJSReceiver, 1), node,
- context, node, start);
+ context, node, success);
Node* select =
graph()->NewNode(common()->Select(MachineRepresentation::kTagged),
check, node, create);
- NodeProperties::ReplaceUses(node, select, check, node, node);
- NodeProperties::ReplaceValueInput(select, node, 1);
- NodeProperties::ReplaceValueInput(check, node, 0);
- NodeProperties::ReplaceEffectInput(check, node);
+ NodeProperties::ReplaceUses(node, select, check, check, node);
+ // Fix-up inputs that have been mangled by the {ReplaceUses} call above.
+ NodeProperties::ReplaceValueInput(select, node, 1); // Fix-up input.
+ NodeProperties::ReplaceValueInput(check, node, 0); // Fix-up input.
+ NodeProperties::ReplaceEffectInput(check, node); // Fix-up input.
+ NodeProperties::ReplaceControlInput(success, node); // Fix-up input.
receiver = create; // The implicit receiver.
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698