| Index: pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
|
| diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
|
| index 0a6984b2c272ea8764a6b7d9fda55b66dd1c1f6d..0c80ea9afb30d9a0a4ccd2b8c2f83425165377df 100644
|
| --- a/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
|
| +++ b/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
|
| @@ -397,7 +397,7 @@ abstract class IrBuilder {
|
| ir.Parameter v = new ir.Parameter(null);
|
| ir.Continuation k = new ir.Continuation([v]);
|
| ir.Expression expression = build(k);
|
| - add(new ir.LetCont(<ir.Continuation>[k], expression));
|
| + add(new ir.LetCont(k, expression));
|
| return v;
|
| }
|
|
|
| @@ -534,16 +534,17 @@ abstract class IrBuilder {
|
|
|
| // Build the term
|
| // let cont join(x, ..., result) = [] in
|
| - // let cont then() = [[thenPart]]; join(v, ...) in
|
| - // let cont else() = [[elsePart]]; join(v, ...) in
|
| + // let cont then() = [[thenPart]]; join(v, ...)
|
| + // and else() = [[elsePart]]; join(v, ...)
|
| + // in
|
| // if condition (then, else)
|
| ir.Continuation thenContinuation = new ir.Continuation([]);
|
| ir.Continuation elseContinuation = new ir.Continuation([]);
|
| thenContinuation.body = thenBuilder._root;
|
| elseContinuation.body = elseBuilder._root;
|
| - add(new ir.LetCont(<ir.Continuation>[joinContinuation],
|
| - new ir.LetCont(<ir.Continuation>[thenContinuation,
|
| - elseContinuation],
|
| + add(new ir.LetCont(joinContinuation,
|
| + new ir.LetCont.many(<ir.Continuation>[thenContinuation,
|
| + elseContinuation],
|
| new ir.Branch(new ir.IsTrue(condition),
|
| thenContinuation,
|
| elseContinuation))));
|
| @@ -787,8 +788,9 @@ abstract class IrBuilder {
|
| buildElsePart(elseBuilder);
|
|
|
| // Build the term
|
| - // (Result =) let cont then() = [[thenPart]] in
|
| - // let cont else() = [[elsePart]] in
|
| + // (Result =) let cont then() = [[thenPart]]
|
| + // and else() = [[elsePart]]
|
| + // in
|
| // if condition (then, else)
|
| ir.Continuation thenContinuation = new ir.Continuation([]);
|
| ir.Continuation elseContinuation = new ir.Continuation([]);
|
| @@ -801,7 +803,7 @@ abstract class IrBuilder {
|
| : <ir.Continuation>[thenContinuation, elseContinuation];
|
|
|
| ir.Expression result =
|
| - new ir.LetCont(arms,
|
| + new ir.LetCont.many(arms,
|
| new ir.Branch(new ir.IsTrue(condition),
|
| thenContinuation,
|
| elseContinuation));
|
| @@ -815,7 +817,7 @@ abstract class IrBuilder {
|
| jumps.addJump(thenBuilder);
|
| jumps.addJump(elseBuilder);
|
| joinContinuation = createJoin(environment.length, jumps);
|
| - result = new ir.LetCont(<ir.Continuation>[joinContinuation], result);
|
| + result = new ir.LetCont(joinContinuation, result);
|
| }
|
|
|
| // The then or else term root could be null, but not both. If there is
|
| @@ -964,7 +966,8 @@ abstract class IrBuilder {
|
| // Note the order of continuations: the first one is the one that will
|
| // be filled by LetCont.plug.
|
| ir.LetCont branch =
|
| - new ir.LetCont(<ir.Continuation>[exitContinuation, bodyContinuation],
|
| + new ir.LetCont.many(<ir.Continuation>[exitContinuation,
|
| + bodyContinuation],
|
| new ir.Branch(new ir.IsTrue(condition),
|
| bodyContinuation,
|
| exitContinuation));
|
| @@ -1000,14 +1003,14 @@ abstract class IrBuilder {
|
| if (hasContinues) {
|
| continueContinuation.body = updateBuilder._root;
|
| bodyContinuation.body =
|
| - new ir.LetCont(<ir.Continuation>[continueContinuation],
|
| + new ir.LetCont(continueContinuation,
|
| bodyBuilder._root);
|
| } else {
|
| bodyContinuation.body = bodyBuilder._root;
|
| }
|
|
|
| loopContinuation.body = condBuilder._root;
|
| - add(new ir.LetCont(<ir.Continuation>[loopContinuation],
|
| + add(new ir.LetCont(loopContinuation,
|
| new ir.InvokeContinuation(loopContinuation,
|
| environment.index2value)));
|
| if (hasBreaks) {
|
| @@ -1066,14 +1069,14 @@ abstract class IrBuilder {
|
|
|
| ir.Parameter iterator = new ir.Parameter(null);
|
| ir.Continuation iteratorInvoked = new ir.Continuation([iterator]);
|
| - add(new ir.LetCont(<ir.Continuation>[iteratorInvoked],
|
| + add(new ir.LetCont(iteratorInvoked,
|
| new ir.InvokeMethod(expressionReceiver,
|
| new Selector.getter("iterator", null), iteratorInvoked,
|
| emptyArguments)));
|
|
|
| ir.Parameter condition = new ir.Parameter(null);
|
| ir.Continuation moveNextInvoked = new ir.Continuation([condition]);
|
| - condBuilder.add(new ir.LetCont(<ir.Continuation>[moveNextInvoked],
|
| + condBuilder.add(new ir.LetCont(moveNextInvoked,
|
| new ir.InvokeMethod(iterator,
|
| new Selector.call("moveNext", null, 0),
|
| moveNextInvoked, emptyArguments)));
|
| @@ -1091,7 +1094,7 @@ abstract class IrBuilder {
|
|
|
| ir.Parameter currentValue = new ir.Parameter(null);
|
| ir.Continuation currentInvoked = new ir.Continuation([currentValue]);
|
| - bodyBuilder.add(new ir.LetCont(<ir.Continuation>[currentInvoked],
|
| + bodyBuilder.add(new ir.LetCont(currentInvoked,
|
| new ir.InvokeMethod(iterator, new Selector.getter("current", null),
|
| currentInvoked, emptyArguments)));
|
| if (Elements.isLocal(variableElement)) {
|
| @@ -1116,7 +1119,8 @@ abstract class IrBuilder {
|
| // Note the order of continuations: the first one is the one that will
|
| // be filled by LetCont.plug.
|
| ir.LetCont branch =
|
| - new ir.LetCont(<ir.Continuation>[exitContinuation, bodyContinuation],
|
| + new ir.LetCont.many(<ir.Continuation>[exitContinuation,
|
| + bodyContinuation],
|
| new ir.Branch(new ir.IsTrue(condition),
|
| bodyContinuation,
|
| exitContinuation));
|
| @@ -1139,7 +1143,7 @@ abstract class IrBuilder {
|
| bodyContinuation.body = bodyBuilder._root;
|
|
|
| loopContinuation.body = condBuilder._root;
|
| - add(new ir.LetCont(<ir.Continuation>[loopContinuation],
|
| + add(new ir.LetCont(loopContinuation,
|
| new ir.InvokeContinuation(loopContinuation,
|
| environment.index2value)));
|
| if (hasBreaks) {
|
| @@ -1204,7 +1208,8 @@ abstract class IrBuilder {
|
| // Note the order of continuations: the first one is the one that will
|
| // be filled by LetCont.plug.
|
| ir.LetCont branch =
|
| - new ir.LetCont(<ir.Continuation>[exitContinuation, bodyContinuation],
|
| + new ir.LetCont.many(<ir.Continuation>[exitContinuation,
|
| + bodyContinuation],
|
| new ir.Branch(new ir.IsTrue(condition),
|
| bodyContinuation,
|
| exitContinuation));
|
| @@ -1226,7 +1231,7 @@ abstract class IrBuilder {
|
| bodyContinuation.body = bodyBuilder._root;
|
|
|
| loopContinuation.body = condBuilder._root;
|
| - add(new ir.LetCont(<ir.Continuation>[loopContinuation],
|
| + add(new ir.LetCont(loopContinuation,
|
| new ir.InvokeContinuation(loopContinuation,
|
| environment.index2value)));
|
| if (hasBreaks) {
|
| @@ -1333,8 +1338,9 @@ abstract class IrBuilder {
|
| elseContinuation.body = new ir.LetPrim(trueConstant)
|
| ..plug(new ir.InvokeContinuation(joinContinuation, [trueConstant]));
|
|
|
| - add(new ir.LetCont(<ir.Continuation>[joinContinuation],
|
| - new ir.LetCont(<ir.Continuation>[thenContinuation, elseContinuation],
|
| + add(new ir.LetCont(joinContinuation,
|
| + new ir.LetCont.many(<ir.Continuation>[thenContinuation,
|
| + elseContinuation],
|
| new ir.Branch(new ir.IsTrue(condition),
|
| thenContinuation,
|
| elseContinuation))));
|
| @@ -1416,8 +1422,8 @@ abstract class IrBuilder {
|
| rightFalseContinuation.body = rightFalseBuilder._root;
|
| // The right subexpression has two continuations.
|
| rightBuilder.add(
|
| - new ir.LetCont(<ir.Continuation>[rightTrueContinuation,
|
| - rightFalseContinuation],
|
| + new ir.LetCont.many(<ir.Continuation>[rightTrueContinuation,
|
| + rightFalseContinuation],
|
| new ir.Branch(new ir.IsTrue(rightValue),
|
| rightTrueContinuation,
|
| rightFalseContinuation)));
|
| @@ -1432,9 +1438,9 @@ abstract class IrBuilder {
|
| leftFalseContinuation.body = emptyBuilder._root;
|
| }
|
|
|
| - add(new ir.LetCont(<ir.Continuation>[joinContinuation],
|
| - new ir.LetCont(<ir.Continuation>[leftTrueContinuation,
|
| - leftFalseContinuation],
|
| + add(new ir.LetCont(joinContinuation,
|
| + new ir.LetCont.many(<ir.Continuation>[leftTrueContinuation,
|
| + leftFalseContinuation],
|
| new ir.Branch(new ir.IsTrue(leftValue),
|
| leftTrueContinuation,
|
| leftFalseContinuation))));
|
|
|