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

Unified Diff: vm/intermediate_language.cc

Issue 10665022: Make IL instructions a doubly-linked list within basic blocks. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: use_ssa flag off by default Created 8 years, 6 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
« vm/intermediate_language.h ('K') | « 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: vm/intermediate_language.cc
===================================================================
--- vm/intermediate_language.cc (revision 9056)
+++ vm/intermediate_language.cc (working copy)
@@ -531,6 +531,36 @@
}
+void Instruction::SetSuccessor(Instruction* instr) {
srdjan 2012/06/25 15:57:16 The two methods are (at least now) very simple set
Florian Schneider 2012/07/02 09:20:42 Done.
+ ASSERT(!IsGraphEntry());
+ ASSERT(!IsReturn());
+ ASSERT(!IsBranch());
+ ASSERT(!IsPhi());
+ // TODO(fschneider): Also add Throw and ReThrow to the list of instructions
+ // that do not have a successor. Currently, the graph builder will continue
+ // to append instruction in case of a Throw inside an expression. This
+ // condition should be handled in the graph builder
+ successor_ = instr;
+}
+
+
+void Instruction::SetPrevious(Instruction* instr) {
+ ASSERT(!IsBlockEntry());
+ previous_ = instr;
+}
+
+
+void Instruction::RemoveFromGraph() {
+ ASSERT(!IsBlockEntry());
+ ASSERT(Previous() != NULL);
+ Instruction* next = StraightLineSuccessor();
+ Previous()->SetSuccessor(next);
+ if (next != NULL && !next->IsBlockEntry()) {
srdjan 2012/06/25 15:57:16 Add parenthesis. Quick question: when is it possib
Florian Schneider 2012/07/02 09:20:42 It can happen. But this just made me realize that
+ next->SetPrevious(Previous());
+ }
srdjan 2012/06/25 15:57:16 Set successor and previous of this instruction to
Florian Schneider 2012/07/02 09:20:42 Done.
+}
+
+
intptr_t GraphEntryInstr::SuccessorCount() const {
return 1 + catch_entries_.length();
}
« vm/intermediate_language.h ('K') | « vm/intermediate_language.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698