Chromium Code Reviews| Index: runtime/vm/intermediate_language.h |
| diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h |
| index 01995ad894732b73fa1f5bc323c7746fa0c6ddfd..7bc041f49631688820bd3b97499a21ba32ae2d9d 100644 |
| --- a/runtime/vm/intermediate_language.h |
| +++ b/runtime/vm/intermediate_language.h |
| @@ -1682,14 +1682,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. |
| @@ -1761,6 +1762,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 |
|
srdjan
2012/07/12 16:42:26
parenthesis
|
| // that do not have a successor. Currently, the graph builder will continue |
| // to append instruction in case of a Throw inside an expression. This |
| @@ -1774,6 +1776,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 |
| @@ -1852,8 +1856,7 @@ FOR_EACH_INSTRUCTION(INSTRUCTION_TYPE_CHECK) |
| class InstructionWithInputs : public Instruction { |
| public: |
| - InstructionWithInputs() : locs_(NULL) { |
| - } |
| + InstructionWithInputs() : locs_(NULL) { } |
| virtual LocationSummary* locs() { |
| if (locs_ == NULL) { |
| @@ -2286,6 +2289,26 @@ class ReThrowInstr : public InstructionWithInputs { |
| }; |
| +class GotoInstr : public InstructionWithInputs { |
|
srdjan
2012/07/12 16:42:26
Why is a goto InstructionWithInputs and not just I
Kevin Millikin (Google)
2012/07/13 15:34:59
Well, it's an instruction with inputs that happens
|
| + 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_; |
|
srdjan
2012/07/12 16:42:26
DISALLOW_...
|
| +}; |
| + |
| + |
| class BranchInstr : public InstructionWithInputs { |
| public: |
| explicit BranchInstr(Value* value) |