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

Unified Diff: runtime/vm/flow_graph_inliner.cc

Issue 47933004: VM: Fix bug in polymorphic inlining of recognized methods. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | « no previous file | runtime/vm/flow_graph_optimizer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_inliner.cc
===================================================================
--- runtime/vm/flow_graph_inliner.cc (revision 29361)
+++ runtime/vm/flow_graph_inliner.cc (working copy)
@@ -1164,13 +1164,23 @@
FlowGraphOptimizer optimizer(owner_->caller_graph());
TargetEntryInstr* entry;
Definition* last;
+ // Replace the receiver argument with a redefinition to prevent code from
+ // the inlined body from being hoisted above the inlined entry.
+ GrowableArray<Definition*> arguments(call_->ArgumentCount());
+ Definition* receiver = call_->ArgumentAt(0);
+ RedefinitionInstr* redefinition =
+ new RedefinitionInstr(new Value(receiver));
+ redefinition->set_ssa_temp_index(
+ owner_->caller_graph()->alloc_ssa_temp_index());
if (optimizer.TryInlineRecognizedMethod(receiver_cid,
target,
call_,
+ redefinition,
call_->instance_call()->token_pos(),
*call_->instance_call()->ic_data(),
&entry, &last)) {
// Create a graph fragment.
+ redefinition->InsertAfter(entry);
InlineExitCollector* exit_collector =
new InlineExitCollector(owner_->caller_graph(), call_);
« no previous file with comments | « no previous file | runtime/vm/flow_graph_optimizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698