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

Unified Diff: runtime/vm/flow_graph.cc

Issue 12335063: Add functions for setting an environment and rebinding a use. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased and incorportated review comments. 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/compiler.cc ('k') | runtime/vm/flow_graph_allocator.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 2c988871a5261f7b710465156796c887138bb0d5..3d2b8c84b81fc06151c543288529c2399a0bd490 100644
--- a/runtime/vm/flow_graph.cc
+++ b/runtime/vm/flow_graph.cc
@@ -72,17 +72,13 @@ void FlowGraph::InsertAfter(Instruction* prev,
Instruction* instr,
Environment* env,
Definition::UseKind use_kind) {
- for (intptr_t i = instr->InputCount() - 1; i >= 0; --i) {
- Value* input = instr->InputAt(i);
- input->definition()->AddInputUse(input);
- }
- ASSERT(instr->env() == NULL);
- if (env != NULL) env->DeepCopyTo(instr);
if (use_kind == Definition::kValue) {
ASSERT(instr->IsDefinition());
instr->AsDefinition()->set_ssa_temp_index(alloc_ssa_temp_index());
}
instr->InsertAfter(prev);
+ ASSERT(instr->env() == NULL);
+ if (env != NULL) env->DeepCopyTo(instr);
}
@@ -472,12 +468,9 @@ void FlowGraph::RenameRecursive(BlockEntryInstr* block_entry,
Environment::From(*env,
num_non_copied_params_,
parsed_function_.function());
- current->set_env(deopt_env);
- intptr_t use_index = 0;
+ current->SetEnvironment(deopt_env);
for (Environment::DeepIterator it(deopt_env); !it.Done(); it.Advance()) {
Value* use = it.CurrentValue();
- use->set_instruction(current);
- use->set_use_index(use_index++);
use->definition()->AddEnvUse(use);
}
}
@@ -499,7 +492,6 @@ void FlowGraph::RenameRecursive(BlockEntryInstr* block_entry,
Definition* input_defn = v->definition();
if (input_defn->IsLoadLocal() || input_defn->IsStoreLocal()) {
// Remove the load/store from the graph.
- input_defn->UnuseAllInputs();
input_defn->RemoveFromGraph();
// Assert we are not referencing nulls in the initial environment.
ASSERT(reaching_defn->ssa_temp_index() != -1);
@@ -544,7 +536,6 @@ void FlowGraph::RenameRecursive(BlockEntryInstr* block_entry,
env->Add((*env)[index]);
// We remove load/store instructions when we find their use in 2a.
} else {
- definition->UnuseAllInputs();
it.RemoveCurrentFromGraph();
}
} else {
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/flow_graph_allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698