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

Unified Diff: runtime/vm/flow_graph_inliner.cc

Issue 11856010: Change the inlining context from an enum to a class. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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
diff --git a/runtime/vm/flow_graph_inliner.cc b/runtime/vm/flow_graph_inliner.cc
index b8ed1762cf46894024ce1e9dd5d12aaee18a07e7..c8b8b7253b498ae52a9d61fd43f91b469879cf50 100644
--- a/runtime/vm/flow_graph_inliner.cc
+++ b/runtime/vm/flow_graph_inliner.cc
@@ -447,15 +447,15 @@ class CallSiteInliner : public ValueObject {
}
// Build the callee graph.
- FlowGraphBuilder builder(*parsed_function);
+ ValueInliningContext* inlining_context = new ValueInliningContext();
+ FlowGraphBuilder builder(*parsed_function, inlining_context);
builder.SetInitialBlockId(caller_graph_->max_block_id());
FlowGraph* callee_graph;
{
TimerScope timer(FLAG_compiler_stats,
&CompilerStats::graphinliner_build_timer,
isolate);
- callee_graph =
- builder.BuildGraph(FlowGraphBuilder::kValueContext, loop_depth);
+ callee_graph = builder.BuildGraph(loop_depth);
}
// The parameter stubs are a copy of the actual arguments providing
@@ -574,7 +574,7 @@ class CallSiteInliner : public ValueObject {
isolate);
// Plug result in the caller graph.
- caller_graph_->InlineCall(call, callee_graph);
+ caller_graph_->InlineCall(call, callee_graph, inlining_context);
// Remove push arguments of the call.
for (intptr_t i = 0; i < call->ArgumentCount(); ++i) {
@@ -597,13 +597,11 @@ class CallSiteInliner : public ValueObject {
callee_graph->graph_entry()->initial_definitions();
for (intptr_t i = 0; i < defns->length(); ++i) {
ConstantInstr* constant = (*defns)[i]->AsConstant();
- if (constant == NULL ||
- ((constant->input_use_list() == NULL) &&
- (constant->env_use_list() == NULL))) {
- continue;
+ if ((constant != NULL) && constant->HasUses()) {
+ constant->ReplaceUsesWith(
+ caller_graph_->AddConstantToInitialDefinitions(
+ constant->value()));
}
- constant->ReplaceUsesWith(
- caller_graph_->AddConstantToInitialDefinitions(constant->value()));
}
}

Powered by Google App Engine
This is Rietveld 408576698