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

Unified Diff: vm/intermediate_language.cc

Issue 10446116: Add flow graph printing into a .cfg file with flag --print-flow-graph-file. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: 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/flow_graph_builder.cc ('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 8145)
+++ vm/intermediate_language.cc (working copy)
@@ -171,6 +171,9 @@
(variable_count == 0) ? NULL : new BitVector(variable_count);
assigned_vars->Add(vars);
+ // The graph entry consists of only one instruction.
+ set_last_instruction(this);
+
// Iteratively traverse all successors. In the unoptimized code, we will
// enter the function at the first successor in reverse postorder, so we
// must visit the normal entry last.
@@ -269,6 +272,44 @@
}
+intptr_t Instruction::SuccessorCount() const {
+ ASSERT(!IsBranch());
+ ASSERT(!IsGraphEntry());
+ ASSERT(StraightLineSuccessor() == NULL ||
+ StraightLineSuccessor()->IsBlockEntry());
+ return StraightLineSuccessor() != NULL ? 1 : 0;
+}
+
+
+BlockEntryInstr* Instruction::SuccessorAt(intptr_t index) const {
+ return StraightLineSuccessor()->AsBlockEntry();
+}
+
+
+intptr_t GraphEntryInstr::SuccessorCount() const {
+ return 1 + catch_entries_.length();
+}
+
+
+BlockEntryInstr* GraphEntryInstr::SuccessorAt(intptr_t index) const {
+ if (index == 0) return normal_entry_;
+ return catch_entries_[index - 1];
+}
+
+
+intptr_t BranchInstr::SuccessorCount() const {
+ return 2;
+}
+
+
+BlockEntryInstr* BranchInstr::SuccessorAt(intptr_t index) const {
+ if (index == 0) return true_successor_;
+ if (index == 1) return false_successor_;
+ UNREACHABLE();
+ return NULL;
+}
+
+
// ==== Support for propagating static type.
RawAbstractType* ConstantVal::StaticType() const {
if (value().IsInstance()) {
« vm/flow_graph_builder.cc ('K') | « vm/intermediate_language.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698