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

Unified Diff: runtime/vm/flow_graph_inliner.cc

Issue 678763004: Make CTX allocatable by the register allocator. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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
Index: runtime/vm/flow_graph_inliner.cc
===================================================================
--- runtime/vm/flow_graph_inliner.cc (revision 41279)
+++ runtime/vm/flow_graph_inliner.cc (working copy)
@@ -926,6 +926,15 @@
constant->ReplaceUsesWith(
caller_graph_->GetConstant(constant->value()));
}
+ CurrentContextInstr* context = (*defns)[i]->AsCurrentContext();
+ if ((context != NULL) && context->HasUses()) {
+ if (call->IsClosureCall()) {
+ context->ReplaceUsesWith(
+ call->AsClosureCall()->context()->definition());
+ } else {
+ context->ReplaceUsesWith(caller_graph_->CurrentContext(call->env()));
Vyacheslav Egorov (Google) 2014/10/28 13:44:58 Just use the empty one here. If it's not a closure
Florian Schneider 2014/10/28 19:04:31 Done.
+ }
+ }
}
// Check that inlining maintains use lists.
@@ -1335,6 +1344,16 @@
constant->ReplaceUsesWith(
owner_->caller_graph()->GetConstant(constant->value()));
}
+ CurrentContextInstr* context = (*defns)[i]->AsCurrentContext();
+ if ((context != NULL) && context->HasUses()) {
+ if (call_data.call->IsClosureCall()) {
+ context->ReplaceUsesWith(
+ call_data.call->AsClosureCall()->context()->definition());
+ } else {
+ context->ReplaceUsesWith(
+ owner_->caller_graph()->CurrentContext(call_data.call->env()));
Vyacheslav Egorov (Google) 2014/10/28 13:44:58 Ditto.
Florian Schneider 2014/10/28 19:04:31 Done.
+ }
+ }
}
return true;
}

Powered by Google App Engine
This is Rietveld 408576698