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

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

Issue 1412223015: [turbofan] Fix receiver binding for inlined callees. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments. Created 5 years, 2 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/js-generic-lowering.cc ('k') | src/compiler/js-intrinsic-lowering.cc » ('j') | 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 3dd02b1e06d7b52445ac0d280ef63d27457eb97a..749ff89bc153abac6716086a4616e32a1503cf93 100644
--- a/src/compiler/js-inlining.cc
+++ b/src/compiler/js-inlining.cc
@@ -420,6 +420,18 @@ Reduction JSInliner::ReduceJSCallFunction(Node* node,
frame_state = CreateArgumentsAdaptorFrameState(&call, info.shared_info());
}
+ // Insert a JSConvertReceiver node for sloppy callees. Note that the context
+ // passed into this node has to be the callees context (loaded above).
+ if (is_sloppy(info.language_mode()) && !function->shared()->native()) {
+ const CallFunctionParameters& p = CallFunctionParametersOf(node->op());
+ Node* effect = NodeProperties::GetEffectInput(node);
+ Node* convert = jsgraph_->graph()->NewNode(
+ jsgraph_->javascript()->ConvertReceiver(p.convert_mode()),
+ call.receiver(), context, frame_state, effect, start);
+ NodeProperties::ReplaceValueInput(node, convert, 1);
+ NodeProperties::ReplaceEffectInput(node, convert);
+ }
+
return InlineCall(node, context, frame_state, start, end);
}
« no previous file with comments | « src/compiler/js-generic-lowering.cc ('k') | src/compiler/js-intrinsic-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698