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

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: incorporated latest comments 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 41393)
+++ runtime/vm/flow_graph_inliner.cc (working copy)
@@ -926,6 +926,20 @@
constant->ReplaceUsesWith(
caller_graph_->GetConstant(constant->value()));
}
+ CurrentContextInstr* context = (*defns)[i]->AsCurrentContext();
+ if ((context != NULL) && context->HasUses()) {
+ ASSERT(call->IsClosureCall());
+ LoadFieldInstr* context_load = new(isolate()) LoadFieldInstr(
+ new Value((*arguments)[0]->definition()),
+ Closure::context_offset(),
+ AbstractType::ZoneHandle(isolate(), AbstractType::null()),
+ call_data->call->token_pos());
+ context_load->set_is_immutable(true);
+ context_load->set_ssa_temp_index(
+ caller_graph_->alloc_ssa_temp_index());
+ context_load->InsertBefore(callee_entry->next());
+ context->ReplaceUsesWith(context_load);
+ }
}
// Check that inlining maintains use lists.
@@ -1335,6 +1349,20 @@
constant->ReplaceUsesWith(
owner_->caller_graph()->GetConstant(constant->value()));
}
+ CurrentContextInstr* context = (*defns)[i]->AsCurrentContext();
+ if ((context != NULL) && context->HasUses()) {
+ ASSERT(call_data.call->IsClosureCall());
+ LoadFieldInstr* context_load = new(isolate()) LoadFieldInstr(
+ new Value(redefinition),
+ Closure::context_offset(),
+ AbstractType::ZoneHandle(isolate(), AbstractType::null()),
+ call_data.call->token_pos());
+ context_load->set_is_immutable(true);
+ context_load->set_ssa_temp_index(
+ owner_->caller_graph()->alloc_ssa_temp_index());
+ context_load->InsertAfter(redefinition);
+ context->ReplaceUsesWith(context_load);
+ }
}
return true;
}

Powered by Google App Engine
This is Rietveld 408576698