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

Unified Diff: runtime/vm/flow_graph.cc

Issue 690043002: Introduce --no-prune-dead-locals flag to disable dead locals pruning. (Closed) Base URL: https://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
« no previous file with comments | « no previous file | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph.cc
diff --git a/runtime/vm/flow_graph.cc b/runtime/vm/flow_graph.cc
index 7caa3f90bb0f9d69673c955cdf797730e5e3874a..cdca0e44541938752e5b90441ca14e67f24a3090 100644
--- a/runtime/vm/flow_graph.cc
+++ b/runtime/vm/flow_graph.cc
@@ -12,6 +12,7 @@
namespace dart {
+DEFINE_FLAG(bool, prune_dead_locals, true, "optimize dead locals away");
DECLARE_FLAG(bool, reorder_basic_blocks);
DECLARE_FLAG(bool, trace_optimization);
DECLARE_FLAG(bool, verify_compiler);
@@ -872,7 +873,7 @@ void FlowGraph::RenameRecursive(BlockEntryInstr* block_entry,
// slots with null.
BitVector* live_in = variable_liveness->GetLiveInSet(block_entry);
for (intptr_t i = 0; i < variable_count(); i++) {
- if (!live_in->Contains(i)) {
+ if (FLAG_prune_dead_locals && !live_in->Contains(i)) {
(*env)[i] = constant_dead();
}
}
@@ -940,7 +941,8 @@ void FlowGraph::RenameRecursive(BlockEntryInstr* block_entry,
intptr_t index = store->local().BitIndexIn(num_non_copied_params_);
result = store->value()->definition();
- if (variable_liveness->IsStoreAlive(block_entry, store)) {
+ if (!FLAG_prune_dead_locals ||
+ variable_liveness->IsStoreAlive(block_entry, store)) {
(*env)[index] = result;
} else {
(*env)[index] = constant_dead();
@@ -958,7 +960,8 @@ void FlowGraph::RenameRecursive(BlockEntryInstr* block_entry,
live_phis->Add(phi);
}
- if (variable_liveness->IsLastLoad(block_entry, load)) {
+ if (FLAG_prune_dead_locals &&
+ variable_liveness->IsLastLoad(block_entry, load)) {
(*env)[index] = constant_dead();
}
« no previous file with comments | « no previous file | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698