Index: vm/intermediate_language.h |
=================================================================== |
--- vm/intermediate_language.h (revision 8145) |
+++ vm/intermediate_language.h (working copy) |
@@ -1347,7 +1347,8 @@ |
virtual type##Instr* As##type() { return this; } \ |
virtual intptr_t InputCount() const; \ |
virtual const char* DebugName() const { return #type; } \ |
- virtual void PrintTo(BufferFormatter* f) const; |
+ virtual void PrintTo(BufferFormatter* f) const; \ |
+ virtual void PrintToVisualizer(BufferFormatter* f) const; |
class Instruction : public ZoneAllocated { |
@@ -1381,6 +1382,12 @@ |
virtual Instruction* StraightLineSuccessor() const = 0; |
virtual void SetSuccessor(Instruction* instr) = 0; |
+ // Normal instructions can have 0 (inside a block) or 1 (last instruction in |
+ // a block) successors. Branch instruction with >1 successors override this |
+ // function. |
+ virtual intptr_t SuccessorCount() const; |
+ virtual BlockEntryInstr* SuccessorAt(intptr_t index) const; |
+ |
virtual void replace_computation(Computation* value) { |
UNREACHABLE(); |
} |
@@ -1414,6 +1421,7 @@ |
// Printing support. |
virtual void PrintTo(BufferFormatter* f) const = 0; |
+ virtual void PrintToVisualizer(BufferFormatter* f) const = 0; |
#define INSTRUCTION_TYPE_CHECK(type) \ |
virtual bool Is##type() const { return false; } \ |
@@ -1519,6 +1527,9 @@ |
virtual Instruction* StraightLineSuccessor() const { return NULL; } |
virtual void SetSuccessor(Instruction* instr) { UNREACHABLE(); } |
+ virtual intptr_t SuccessorCount() const; |
+ virtual BlockEntryInstr* SuccessorAt(intptr_t index) const; |
+ |
virtual void DiscoverBlocks( |
BlockEntryInstr* current_block, |
GrowableArray<BlockEntryInstr*>* preorder, |
@@ -1834,6 +1845,9 @@ |
virtual Instruction* StraightLineSuccessor() const { return NULL; } |
virtual void SetSuccessor(Instruction* instr) { UNREACHABLE(); } |
+ virtual intptr_t SuccessorCount() const; |
+ virtual BlockEntryInstr* SuccessorAt(intptr_t index) const; |
+ |
virtual void DiscoverBlocks( |
BlockEntryInstr* current_block, |
GrowableArray<BlockEntryInstr*>* preorder, |