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

Unified Diff: runtime/vm/intermediate_language.h

Issue 10735071: Introduce Goto instructions to the flow graph. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Tweaked instruction numbering. Created 8 years, 5 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
Index: runtime/vm/intermediate_language.h
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index 8df33ee0dc622f68cdd65f99e2bcec317959044e..103f7490ed1757ce76141e079d3bfdc80bd0010d 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -1688,14 +1688,15 @@ FOR_EACH_COMPUTATION(DEFINE_PREDICATE)
M(GraphEntry) \
M(JoinEntry) \
M(TargetEntry) \
- M(Bind) \
M(Phi) \
+ M(Bind) \
+ M(Parameter) \
+ M(ParallelMove) \
M(Return) \
M(Throw) \
M(ReThrow) \
+ M(Goto) \
M(Branch) \
- M(ParallelMove) \
- M(Parameter)
// Forward declarations for Instruction classes.
@@ -1767,6 +1768,7 @@ class Instruction : public ZoneAllocated {
ASSERT(!IsReturn());
ASSERT(!IsBranch());
ASSERT(!IsPhi());
+ ASSERT(instr == NULL || !instr->IsBlockEntry());
// 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
@@ -1780,6 +1782,8 @@ class Instruction : public ZoneAllocated {
virtual intptr_t SuccessorCount() const;
virtual BlockEntryInstr* SuccessorAt(intptr_t index) const;
+ void Goto(JoinEntryInstr* entry);
+
// Discover basic-block structure by performing a recursive depth first
// traversal of the instruction graph reachable from this instruction. As
// a side effect, the block entry instructions in the graph are assigned
@@ -1858,8 +1862,7 @@ FOR_EACH_INSTRUCTION(INSTRUCTION_TYPE_CHECK)
class InstructionWithInputs : public Instruction {
public:
- InstructionWithInputs() : locs_(NULL) {
- }
+ InstructionWithInputs() : locs_(NULL) { }
virtual LocationSummary* locs() {
if (locs_ == NULL) {
@@ -2292,6 +2295,26 @@ class ReThrowInstr : public InstructionWithInputs {
};
+class GotoInstr : public InstructionWithInputs {
+ public:
+ explicit GotoInstr(JoinEntryInstr* entry) : successor_(entry) { }
+
+ DECLARE_INSTRUCTION(Goto)
+
+ JoinEntryInstr* successor() const { return successor_; }
+ void set_successor(JoinEntryInstr* successor) { successor_ = successor; }
+ virtual intptr_t SuccessorCount() const;
+ virtual BlockEntryInstr* SuccessorAt(intptr_t index) const;
+
+ virtual LocationSummary* MakeLocationSummary() const;
+
+ virtual void EmitNativeCode(FlowGraphCompiler* compiler);
+
+ private:
+ JoinEntryInstr* successor_;
+};
+
+
class BranchInstr : public InstructionWithInputs {
public:
explicit BranchInstr(Value* value)

Powered by Google App Engine
This is Rietveld 408576698