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

Unified Diff: runtime/vm/intermediate_language.h

Issue 10399026: Add a global graph entry. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 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/il_printer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.h
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index 975a57d123841367a722e7e2d324453e7bc603a4..9cd9ab58d4d2b752a601827ae2f38e24095179dd 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -1125,6 +1125,7 @@ class CatchEntryComp : public TemplateComputation<0> {
// type name. The concrete instruction classes are the name with Instr
// concatenated.
#define FOR_EACH_INSTRUCTION(M) \
+ M(GraphEntry) \
M(JoinEntry) \
M(TargetEntry) \
M(Do) \
@@ -1214,10 +1215,11 @@ FOR_EACH_INSTRUCTION(INSTRUCTION_TYPE_CHECK)
};
-// Basic block entries are administrative nodes. Joins are the only nodes
-// with multiple predecessors. Targets are the other basic block entries.
-// The types enforce edge-split form---joins are forbidden as the successors
-// of branches.
+// Basic block entries are administrative nodes. There is a distinguished
+// graph entry with no predecessor. Joins are the only nodes with multiple
+// predecessors. Targets are all other basic block entries. The types
+// enforce edge-split form---joins are forbidden as the successors of
+// branches.
class BlockEntryInstr : public Instruction {
public:
virtual bool IsBlockEntry() const { return true; }
@@ -1254,6 +1256,38 @@ class BlockEntryInstr : public Instruction {
};
+class GraphEntryInstr : public BlockEntryInstr {
+ public:
+ explicit GraphEntryInstr(TargetEntryInstr* normal_entry)
+ : BlockEntryInstr(), normal_entry_(normal_entry), catch_entries_() { }
+
+ DECLARE_INSTRUCTION(GraphEntry)
+
+ virtual intptr_t PredecessorCount() const { return 0; }
+ virtual BlockEntryInstr* PredecessorAt(intptr_t index) const {
+ UNREACHABLE();
+ return NULL;
+ }
+
+ virtual Instruction* StraightLineSuccessor() const { return NULL; }
+ virtual void SetSuccessor(Instruction* instr) { UNREACHABLE(); }
+
+ virtual void DiscoverBlocks(
+ BlockEntryInstr* current_block,
+ GrowableArray<BlockEntryInstr*>* preorder,
+ GrowableArray<BlockEntryInstr*>* postorder,
+ GrowableArray<intptr_t>* parent);
+
+ void AddCatchEntry(TargetEntryInstr* entry) { catch_entries_.Add(entry); }
+
+ private:
+ TargetEntryInstr* normal_entry_;
+ ZoneGrowableArray<TargetEntryInstr*> catch_entries_;
srdjan 2012/05/16 15:20:27 GrowableArray, since it is a value object.
+
+ DISALLOW_COPY_AND_ASSIGN(GraphEntryInstr);
+};
+
+
class JoinEntryInstr : public BlockEntryInstr {
public:
JoinEntryInstr()
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698