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 tree_ir_builder; | 5 library tree_ir_builder; |
6 | 6 |
7 import '../dart2jslib.dart' as dart2js; | 7 import '../dart2jslib.dart' as dart2js; |
8 import '../dart_types.dart'; | 8 import '../dart_types.dart'; |
9 import '../elements/elements.dart'; | 9 import '../elements/elements.dart'; |
10 import '../cps_ir/cps_ir_nodes.dart' as cps_ir; | 10 import '../cps_ir/cps_ir_nodes.dart' as cps_ir; |
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
660 Node visitTypeExpression(cps_ir.TypeExpression node) { | 660 Node visitTypeExpression(cps_ir.TypeExpression node) { |
661 return new TypeExpression( | 661 return new TypeExpression( |
662 node.dartType, | 662 node.dartType, |
663 node.arguments.map(getVariableUse).toList()); | 663 node.arguments.map(getVariableUse).toList()); |
664 } | 664 } |
665 | 665 |
666 Expression visitGetStatic(cps_ir.GetStatic node) { | 666 Expression visitGetStatic(cps_ir.GetStatic node) { |
667 return new GetStatic(node.element, node.sourceInformation); | 667 return new GetStatic(node.element, node.sourceInformation); |
668 } | 668 } |
669 | 669 |
| 670 Statement visitGetLazyStatic(cps_ir.GetLazyStatic node) { |
| 671 // In the tree IR, GetStatic handles lazy fields because tree |
| 672 // expressions are allowed to have side effects. |
| 673 GetStatic value = new GetStatic(node.element, node.sourceInformation); |
| 674 return continueWithExpression(node.continuation, value); |
| 675 } |
| 676 |
670 Statement visitSetStatic(cps_ir.SetStatic node) { | 677 Statement visitSetStatic(cps_ir.SetStatic node) { |
671 SetStatic setStatic = new SetStatic( | 678 SetStatic setStatic = new SetStatic( |
672 node.element, | 679 node.element, |
673 getVariableUse(node.value), | 680 getVariableUse(node.value), |
674 node.sourceInformation); | 681 node.sourceInformation); |
675 return new ExpressionStatement(setStatic, visit(node.body)); | 682 return new ExpressionStatement(setStatic, visit(node.body)); |
676 } | 683 } |
677 } | 684 } |
678 | 685 |
OLD | NEW |