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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 11043016: Set previous instruction pointers when building the graph. (Closed) Base URL: https://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 | « runtime/vm/intermediate_language.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.cc
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index efb711115619214de47c3541b1112b050686fbf9..10b5d017e89ba56dd45b36ddb37127112c1379d6 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -239,8 +239,7 @@ Instruction* Instruction::RemoveFromGraph(bool return_previous) {
Instruction* next_instr = next();
ASSERT(next_instr != NULL);
ASSERT(!next_instr->IsBlockEntry());
- prev_instr->set_next(next_instr);
- next_instr->set_previous(prev_instr);
+ prev_instr->LinkTo(next_instr);
// Reset successor and previous instruction to indicate
// that the instruction is removed from the graph.
set_previous(NULL);
@@ -589,12 +588,10 @@ void Definition::ReplaceWith(Definition* other,
ASSERT(!other->HasSSATemp());
if (HasSSATemp()) other->set_ssa_temp_index(ssa_temp_index());
- other->set_previous(previous());
- previous()->set_next(other);
- set_previous(NULL);
+ previous()->LinkTo(other);
+ other->LinkTo(next());
- other->set_next(next());
- next()->set_previous(other);
+ set_previous(NULL);
set_next(NULL);
}
}
@@ -880,7 +877,7 @@ BlockEntryInstr* GotoInstr::SuccessorAt(intptr_t index) const {
void Instruction::Goto(JoinEntryInstr* entry) {
- set_next(new GotoInstr(entry));
+ LinkTo(new GotoInstr(entry));
}
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698