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

Unified Diff: runtime/vm/flow_graph.cc

Issue 11225028: Avoid creating unnecessary environments during SSA renaming. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph.cc
===================================================================
--- runtime/vm/flow_graph.cc (revision 13860)
+++ runtime/vm/flow_graph.cc (working copy)
@@ -523,15 +523,14 @@
// 2. Process normal instructions.
for (ForwardInstructionIterator it(block_entry); !it.Done(); it.Advance()) {
Instruction* current = it.Current();
- // Attach current environment to the instruction. First, each instruction
- // gets a full copy of the environment. Later we optimize this by
- // eliminating unnecessary environments.
- // TODO(zerny): Avoid creating unnecessary environments. Note that some
- // optimizations need deoptimization info for non-deoptable instructions,
- // eg, LICM on GOTOs.
- current->set_env(Environment::From(*env,
- num_non_copied_params_,
- parsed_function_.function()));
+ // Attach current environment to the instructions that can deoptimize and
+ // at goto instructions. Optimizations like LICM expect an environment at
+ // gotos.
+ if (current->CanDeoptimize() || current->IsGoto()) {
+ current->set_env(Environment::From(*env,
+ num_non_copied_params_,
+ parsed_function_.function()));
+ }
if (current->CanDeoptimize()) {
current->env()->set_deopt_id(current->deopt_id());
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698