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 '../common.dart'; | 7 import '../common.dart'; |
8 import '../constants/values.dart'; | 8 import '../constants/values.dart'; |
9 import '../cps_ir/cps_ir_nodes.dart' as cps_ir; | 9 import '../cps_ir/cps_ir_nodes.dart' as cps_ir; |
10 import '../elements/elements.dart'; | 10 import '../elements/elements.dart'; |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 visitNullCheck(cps_ir.NullCheck node) => (Statement next) { | 657 visitNullCheck(cps_ir.NullCheck node) => (Statement next) { |
658 return new NullCheck( | 658 return new NullCheck( |
659 condition: getVariableUseOrNull(node.condition), | 659 condition: getVariableUseOrNull(node.condition), |
660 value: getVariableUse(node.value), | 660 value: getVariableUse(node.value), |
661 selector: node.selector, | 661 selector: node.selector, |
662 next: next, | 662 next: next, |
663 sourceInformation: node.sourceInformation); | 663 sourceInformation: node.sourceInformation); |
664 }; | 664 }; |
665 | 665 |
666 Expression visitGetLazyStatic(cps_ir.GetLazyStatic node) { | 666 Expression visitGetLazyStatic(cps_ir.GetLazyStatic node) { |
667 // In the tree IR, GetStatic handles lazy fields because we do not need | 667 return new GetStatic.lazy(node.element, node.sourceInformation); |
668 // as fine-grained control over side effects. | |
669 return new GetStatic(node.element, node.sourceInformation); | |
670 } | 668 } |
671 | 669 |
672 @override | 670 @override |
673 NodeCallback visitYield(cps_ir.Yield node) { | 671 NodeCallback visitYield(cps_ir.Yield node) { |
674 return (Statement next) { | 672 return (Statement next) { |
675 return new Yield(getVariableUse(node.input), node.hasStar, next); | 673 return new Yield(getVariableUse(node.input), node.hasStar, next); |
676 }; | 674 }; |
677 } | 675 } |
678 | 676 |
679 @override | 677 @override |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
722 --enclosingFunctions; | 720 --enclosingFunctions; |
723 } | 721 } |
724 | 722 |
725 @override | 723 @override |
726 visitInterpolatedNode(js.InterpolatedNode node) { | 724 visitInterpolatedNode(js.InterpolatedNode node) { |
727 if (enclosingFunctions > 0) { | 725 if (enclosingFunctions > 0) { |
728 found = true; | 726 found = true; |
729 } | 727 } |
730 } | 728 } |
731 } | 729 } |
OLD | NEW |