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

Unified Diff: runtime/vm/flow_graph_inliner.cc

Issue 12317007: Remove two more places where we computed use lists and add verification. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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 | « runtime/vm/flow_graph.cc ('k') | runtime/vm/flow_graph_type_propagator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_inliner.cc
diff --git a/runtime/vm/flow_graph_inliner.cc b/runtime/vm/flow_graph_inliner.cc
index 45b7fd362a757e709768c9b4399b9f38278d6277..e98927b8e6bf50a7806f3bcb224304dcd8fb7478 100644
--- a/runtime/vm/flow_graph_inliner.cc
+++ b/runtime/vm/flow_graph_inliner.cc
@@ -501,7 +501,7 @@ class CallSiteInliner : public ValueObject {
// TODO(zerny): Do more optimization passes on the callee graph.
FlowGraphOptimizer optimizer(callee_graph);
optimizer.ApplyICData();
- callee_graph->ComputeUseLists();
+ DEBUG_ASSERT(callee_graph->VerifyUseLists());
}
if (FLAG_trace_inlining &&
@@ -561,13 +561,6 @@ class CallSiteInliner : public ValueObject {
// Plug result in the caller graph.
inlining_context->ReplaceCall(caller_graph_, call, callee_graph);
- // Remove push arguments of the call.
- for (intptr_t i = 0; i < call->ArgumentCount(); ++i) {
- PushArgumentInstr* push = call->PushArgumentAt(i);
- push->ReplaceUsesWith(push->value()->definition());
- push->RemoveFromGraph();
- }
-
// Replace each stub with the actual argument or the caller's constant.
// Nulls denote optional parameters for which no actual was given.
for (intptr_t i = 0; i < arguments->length(); ++i) {
@@ -576,6 +569,14 @@ class CallSiteInliner : public ValueObject {
if (actual != NULL) stub->ReplaceUsesWith(actual->definition());
}
+ // Remove push arguments of the call.
+ for (intptr_t i = 0; i < call->ArgumentCount(); ++i) {
+ PushArgumentInstr* push = call->PushArgumentAt(i);
+ push->ReplaceUsesWith(push->value()->definition());
+ push->UnuseAllInputs();
+ push->RemoveFromGraph();
+ }
+
// Replace remaining constants with uses by constants in the caller's
// initial definitions.
GrowableArray<Definition*>* defns =
@@ -596,7 +597,7 @@ class CallSiteInliner : public ValueObject {
if (!in_cache) function_cache_.Add(parsed_function);
// Check that inlining maintains use lists.
- DEBUG_ASSERT(!FLAG_verify_compiler || caller_graph_->ValidateUseLists());
+ DEBUG_ASSERT(!FLAG_verify_compiler || caller_graph_->VerifyUseLists());
// Build succeeded so we restore the bailout jump.
inlined_ = true;
« no previous file with comments | « runtime/vm/flow_graph.cc ('k') | runtime/vm/flow_graph_type_propagator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698