Chromium Code Reviews| Index: frog/leg/ssa/nodes.dart |
| diff --git a/frog/leg/ssa/nodes.dart b/frog/leg/ssa/nodes.dart |
| index 2a3402a2d48394c4a5f53270e42f0ca21f7ce564..a3760b101aa48946ec1d29e8651ddb6edd4bde3c 100644 |
| --- a/frog/leg/ssa/nodes.dart |
| +++ b/frog/leg/ssa/nodes.dart |
| @@ -1353,7 +1353,7 @@ class HInvokeBinary extends HInvokeStatic { |
| } |
| return leftType.combine(rightType); |
| } |
| - |
| + |
| abstract HInstruction fold(HGraph graph); |
| abstract evaluate(num a, num b); |
| } |
| @@ -1790,21 +1790,17 @@ class HIf extends HConditionalBranch { |
| } |
| class HLoopBranch extends HConditionalBranch { |
| - HLoopBranch(HInstruction condition) : super(<HInstruction>[condition]); |
| + static final int CONDITION_FIRST_LOOP = 0; |
| + static final int DO_WHILE_LOOP = 1; |
| + |
| + final int kind; |
| + HLoopBranch(HInstruction condition, [this.kind = CONDITION_FIRST_LOOP]) |
| + : super(<HInstruction>[condition]); |
| toString() => 'loop-branch'; |
| accept(HVisitor visitor) => visitor.visitLoopBranch(this); |
| bool isDoWhile() { |
| - bool result = block.dominatedBlocks.length == 1; |
| - if (result) { |
| - // The first successor is the loop-body and thus a back-edge. |
| - assert(block.successors[0].id < block.id); |
| - assert(block.dominatedBlocks[0] === block.successors[1]); |
| - } else { |
| - assert(block.dominatedBlocks[0] === block.successors[0]); |
| - assert(block.dominatedBlocks[1] === block.successors[1]);; |
| - } |
| - return result; |
| + return kind === DO_WHILE_LOOP; |
| } |
| } |
| @@ -1885,6 +1881,7 @@ class HPhi extends HInstruction { |
| // The order of the [inputs] must correspond to the order of the |
| // predecessor-edges. That is if an input comes from the first predecessor |
| // of the surrounding block, then the input must be the first in the [HPhi]. |
| + HPhi(this.element) : super(<HInstruction>[]); |
|
karlklose
2012/02/29 10:17:38
I would prefer to have a constructor HPhi(element,
Lasse Reichstein Nielsen
2012/02/29 10:42:02
Done. The HPhi is now equivalent to HPhi.multipleI
|
| HPhi.singleInput(this.element, HInstruction input) |
| : super(<HInstruction>[input]); |
| HPhi.manyInputs(this.element, List<HInstruction> inputs) |