OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library backend_ast_emitter; | 5 library backend_ast_emitter; |
6 | 6 |
7 import '../tree_ir/tree_ir_nodes.dart' as tree; | 7 import '../tree_ir/tree_ir_nodes.dart' as tree; |
8 import 'backend_ast_nodes.dart'; | 8 import 'backend_ast_nodes.dart'; |
9 import '../constants/expressions.dart'; | 9 import '../constants/expressions.dart'; |
10 import '../constants/values.dart'; | 10 import '../constants/values.dart'; |
(...skipping 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1272 } else { | 1272 } else { |
1273 return exp.falseExp.accept(this); | 1273 return exp.falseExp.accept(this); |
1274 } | 1274 } |
1275 } | 1275 } |
1276 | 1276 |
1277 @override | 1277 @override |
1278 Expression visitUnary(UnaryConstantExpression exp, | 1278 Expression visitUnary(UnaryConstantExpression exp, |
1279 BuilderContext<Statement> context) { | 1279 BuilderContext<Statement> context) { |
1280 return handlePrimitiveConstant(exp.value); | 1280 return handlePrimitiveConstant(exp.value); |
1281 } | 1281 } |
| 1282 |
| 1283 @override |
| 1284 Expression visitDeferred(DeferredConstantExpression exp, |
| 1285 BuilderContext<Statement> context) { |
| 1286 return exp.expression.accept(this); |
| 1287 } |
1282 } | 1288 } |
1283 | 1289 |
1284 /// Moves function parameters into a separate variable if one of its uses is | 1290 /// Moves function parameters into a separate variable if one of its uses is |
1285 /// shadowed by an inner function parameter. | 1291 /// shadowed by an inner function parameter. |
1286 /// This artifact is necessary because function parameters cannot be renamed. | 1292 /// This artifact is necessary because function parameters cannot be renamed. |
1287 class UnshadowParameters extends tree.RecursiveVisitor { | 1293 class UnshadowParameters extends tree.RecursiveVisitor { |
1288 | 1294 |
1289 /// Maps parameter names to their bindings. | 1295 /// Maps parameter names to their bindings. |
1290 Map<String, tree.Variable> environment = <String, tree.Variable>{}; | 1296 Map<String, tree.Variable> environment = <String, tree.Variable>{}; |
1291 | 1297 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1359 : super(name, ElementKind.VARIABLE, enclosingElement, variables, null); | 1365 : super(name, ElementKind.VARIABLE, enclosingElement, variables, null); |
1360 | 1366 |
1361 ExecutableElement get executableContext => enclosingElement; | 1367 ExecutableElement get executableContext => enclosingElement; |
1362 | 1368 |
1363 ExecutableElement get memberContext => executableContext.memberContext; | 1369 ExecutableElement get memberContext => executableContext.memberContext; |
1364 | 1370 |
1365 bool get isLocal => true; | 1371 bool get isLocal => true; |
1366 | 1372 |
1367 LibraryElement get implementationLibrary => enclosingElement.library; | 1373 LibraryElement get implementationLibrary => enclosingElement.library; |
1368 } | 1374 } |
OLD | NEW |