Chromium Code Reviews| 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() |