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

Unified Diff: runtime/vm/flow_graph_allocator.cc

Issue 10765007: Cleanups. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 5 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/flow_graph_builder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_allocator.cc
===================================================================
--- runtime/vm/flow_graph_allocator.cc (revision 9469)
+++ runtime/vm/flow_graph_allocator.cc (working copy)
@@ -29,12 +29,6 @@
}
-static intptr_t ToVirtualRegister(Instruction* instr) {
- const Definition* def = instr->AsDefinition();
- return (def == NULL) ? -1 : def->ssa_temp_index();
-}
-
-
void FlowGraphAllocator::ComputeInitialSets() {
const intptr_t block_count = postorder_.length();
for (intptr_t i = 0; i < block_count; i++) {
@@ -49,16 +43,13 @@
for (intptr_t j = 0; j < join->phis()->length(); j++) {
PhiInstr* phi = (*join->phis())[j];
if (phi == NULL) continue;
+ kill->Add(phi->ssa_temp_index());
- const intptr_t def = ToVirtualRegister(phi);
- if (def >= 0) kill->Add(def);
-
for (intptr_t k = 0; k < phi->InputCount(); k++) {
Value* val = phi->InputAt(k);
- if (!val->IsUse()) continue;
- const intptr_t use = ToVirtualRegister(val->AsUse()->definition());
- if (use >= 0) {
+ if (val->IsUse()) {
BlockEntryInstr* pred = block->PredecessorAt(k);
+ const intptr_t use = val->AsUse()->definition()->ssa_temp_index();
live_out_[pred->postorder_number()]->Add(use);
}
}
@@ -71,13 +62,16 @@
Instruction* current = it.Current();
for (intptr_t j = 0; j < current->InputCount(); j++) {
Value* input = current->InputAt(j);
- if (!input->IsUse()) continue;
- const intptr_t use = ToVirtualRegister(input->AsUse()->definition());
- if ((use >= 0) && !kill->Contains(use)) live_in->Add(use);
+ if (input->IsUse()) {
+ const intptr_t use = input->AsUse()->definition()->ssa_temp_index();
+ if (!kill->Contains(use)) live_in->Add(use);
+ }
}
- const intptr_t def = ToVirtualRegister(current);
- if (def >= 0) kill->Add(def);
+ Definition* current_def = current->AsDefinition();
+ if ((current_def != NULL) && (current_def->ssa_temp_index() >= 0)) {
+ kill->Add(current_def->ssa_temp_index());
+ }
}
}
« no previous file with comments | « no previous file | runtime/vm/flow_graph_builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698