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 library simple_types_inferrer; | 5 library simple_types_inferrer; |
6 | 6 |
7 import '../closure.dart' show ClosureClassMap; | 7 import '../closure.dart' show ClosureClassMap; |
8 import '../common.dart'; | 8 import '../common.dart'; |
9 import '../common/names.dart' show Identifiers, Selectors; | 9 import '../common/names.dart' show Identifiers, Selectors; |
10 import '../compiler.dart' show Compiler; | 10 import '../compiler.dart' show Compiler; |
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 updateIsChecks(tests, usePositive: true); | 691 updateIsChecks(tests, usePositive: true); |
692 visit(node.body); | 692 visit(node.body); |
693 }); | 693 }); |
694 } | 694 } |
695 | 695 |
696 TypeInformation visitDoWhile(ast.DoWhile node) { | 696 TypeInformation visitDoWhile(ast.DoWhile node) { |
697 return handleLoop(node, () { | 697 return handleLoop(node, () { |
698 visit(node.body); | 698 visit(node.body); |
699 List<ast.Send> tests = <ast.Send>[]; | 699 List<ast.Send> tests = <ast.Send>[]; |
700 handleCondition(node.condition, tests); | 700 handleCondition(node.condition, tests); |
701 updateIsChecks(tests, usePositive: true); | 701 // TODO(29309): This condition appears to stengthen both the back-edge and |
| 702 // exit-edge. For now, avoid strengthening on the condition until the |
| 703 // proper fix is found. |
| 704 // |
| 705 // updateIsChecks(tests, usePositive: true); |
702 }); | 706 }); |
703 } | 707 } |
704 | 708 |
705 TypeInformation visitFor(ast.For node) { | 709 TypeInformation visitFor(ast.For node) { |
706 visit(node.initializer); | 710 visit(node.initializer); |
707 return handleLoop(node, () { | 711 return handleLoop(node, () { |
708 List<ast.Send> tests = <ast.Send>[]; | 712 List<ast.Send> tests = <ast.Send>[]; |
709 handleCondition(node.condition, tests); | 713 handleCondition(node.condition, tests); |
710 updateIsChecks(tests, usePositive: true); | 714 updateIsChecks(tests, usePositive: true); |
711 visit(node.body); | 715 visit(node.body); |
(...skipping 2228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2940 Selector moveNextSelector = Selectors.moveNext; | 2944 Selector moveNextSelector = Selectors.moveNext; |
2941 TypeMask moveNextMask = inTreeData.typeOfIteratorMoveNext(node); | 2945 TypeMask moveNextMask = inTreeData.typeOfIteratorMoveNext(node); |
2942 | 2946 |
2943 TypeInformation iteratorType = handleDynamicSend(node, iteratorSelector, | 2947 TypeInformation iteratorType = handleDynamicSend(node, iteratorSelector, |
2944 iteratorMask, expressionType, new ArgumentsTypes.empty()); | 2948 iteratorMask, expressionType, new ArgumentsTypes.empty()); |
2945 | 2949 |
2946 return handleForInLoop(node, iteratorType, currentSelector, currentMask, | 2950 return handleForInLoop(node, iteratorType, currentSelector, currentMask, |
2947 moveNextSelector, moveNextMask); | 2951 moveNextSelector, moveNextMask); |
2948 } | 2952 } |
2949 } | 2953 } |
OLD | NEW |