| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // IrNodes are kept in a separate library to have precise control over their | 5 // IrNodes are kept in a separate library to have precise control over their |
| 6 // dependencies on other parts of the system. | 6 // dependencies on other parts of the system. |
| 7 library dart2js.ir_nodes; | 7 library dart2js.ir_nodes; |
| 8 | 8 |
| 9 import '../constants/expressions.dart'; | 9 import '../constants/expressions.dart'; |
| 10 import '../constants/values.dart' as values show ConstantValue; | 10 import '../constants/values.dart' as values show ConstantValue; |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 /// | 133 /// |
| 134 /// The bound continuations are in scope in the body and the continuation | 134 /// The bound continuations are in scope in the body and the continuation |
| 135 /// parameters are in scope in the respective continuation bodies. | 135 /// parameters are in scope in the respective continuation bodies. |
| 136 /// During one-pass construction a LetCont whose first continuation has an empty | 136 /// During one-pass construction a LetCont whose first continuation has an empty |
| 137 /// body is used to represent the one-level context | 137 /// body is used to represent the one-level context |
| 138 /// 'let cont ... k(v) = [] ... in E'. | 138 /// 'let cont ... k(v) = [] ... in E'. |
| 139 class LetCont extends Expression implements InteriorNode { | 139 class LetCont extends Expression implements InteriorNode { |
| 140 List<Continuation> continuations; | 140 List<Continuation> continuations; |
| 141 Expression body; | 141 Expression body; |
| 142 | 142 |
| 143 LetCont(this.continuations, this.body); | 143 LetCont(Continuation continuation, this.body) |
| 144 : continuations = <Continuation>[continuation]; |
| 145 |
| 146 LetCont.many(this.continuations, this.body); |
| 144 | 147 |
| 145 Expression plug(Expression expr) { | 148 Expression plug(Expression expr) { |
| 146 assert(continuations != null && | 149 assert(continuations != null && |
| 147 continuations.isNotEmpty && | 150 continuations.isNotEmpty && |
| 148 continuations.first.body == null); | 151 continuations.first.body == null); |
| 149 return continuations.first.body = expr; | 152 return continuations.first.body = expr; |
| 150 } | 153 } |
| 151 | 154 |
| 152 accept(Visitor visitor) => visitor.visitLetCont(this); | 155 accept(Visitor visitor) => visitor.visitLetCont(this); |
| 153 } | 156 } |
| (...skipping 1157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1311 | 1314 |
| 1312 void visitIdentical(Identical node) { | 1315 void visitIdentical(Identical node) { |
| 1313 visitReference(node.left); | 1316 visitReference(node.left); |
| 1314 visitReference(node.right); | 1317 visitReference(node.right); |
| 1315 } | 1318 } |
| 1316 | 1319 |
| 1317 void visitInterceptor(Interceptor node) { | 1320 void visitInterceptor(Interceptor node) { |
| 1318 visitReference(node.input); | 1321 visitReference(node.input); |
| 1319 } | 1322 } |
| 1320 } | 1323 } |
| OLD | NEW |