Index: lib/compiler/implementation/ssa/builder.dart |
diff --git a/lib/compiler/implementation/ssa/builder.dart b/lib/compiler/implementation/ssa/builder.dart |
index 995a244337dc3cad8ea58310f6310e68baae0a87..367c719fafb73fcf2df7c61c3cbe9d4a28038275 100644 |
--- a/lib/compiler/implementation/ssa/builder.dart |
+++ b/lib/compiler/implementation/ssa/builder.dart |
@@ -1019,6 +1019,10 @@ class SsaBuilder implements Visitor { |
return stack.removeLast(); |
} |
+ void dup() { |
+ stack.add(stack.last()); |
+ } |
+ |
HBoolify popBoolified() { |
HBoolify boolified = new HBoolify(pop()); |
add(boolified); |
@@ -2298,6 +2302,17 @@ class SsaBuilder implements Visitor { |
unreachable(); |
} |
+ visitCascade(Cascade node) { |
+ visit(node.expression); |
+ // Remove the result and reveal the duplicated receiver on the stack. |
+ pop(); |
+ } |
+ |
+ visitCascadeReceiver(CascadeReceiver node) { |
+ visit(node.expression); |
+ dup(); |
+ } |
+ |
visitReturn(Return node) { |
HInstruction value; |
if (node.expression === null) { |