| 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 compiler.src.inferrer.list_tracer; | 5 library compiler.src.inferrer.list_tracer; |
| 6 | 6 |
| 7 import '../elements/elements.dart'; | 7 import '../elements/elements.dart'; |
| 8 import '../js_backend/backend_helpers.dart'; | 8 import '../js_backend/backend_helpers.dart'; |
| 9 import '../universe/selector.dart' show Selector; | 9 import '../universe/selector.dart' show Selector; |
| 10 import '../util/util.dart' show Setlet; | 10 import '../util/util.dart' show Setlet; |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 'lastIndexOf', | 123 'lastIndexOf', |
| 124 'sublist', | 124 'sublist', |
| 125 'getRange', | 125 'getRange', |
| 126 'asMap', | 126 'asMap', |
| 127 | 127 |
| 128 // From JSArray. | 128 // From JSArray. |
| 129 'checkMutable', | 129 'checkMutable', |
| 130 'checkGrowable', | 130 'checkGrowable', |
| 131 ]); | 131 ]); |
| 132 | 132 |
| 133 class ListTracerVisitor extends TracerVisitor<ListTypeInformation> { | 133 class ListTracerVisitor extends TracerVisitor { |
| 134 // The [Set] of found assignments to the list. | 134 // The [Set] of found assignments to the list. |
| 135 Set<TypeInformation> assignments = new Setlet<TypeInformation>(); | 135 Set<TypeInformation> assignments = new Setlet<TypeInformation>(); |
| 136 bool callsGrowableMethod = false; | 136 bool callsGrowableMethod = false; |
| 137 | 137 |
| 138 ListTracerVisitor(tracedType, inferrer) : super(tracedType, inferrer); | 138 ListTracerVisitor(tracedType, inferrer) : super(tracedType, inferrer); |
| 139 | 139 |
| 140 /** | 140 /** |
| 141 * Returns [true] if the analysis completed successfully, [false] if it | 141 * Returns [true] if the analysis completed successfully, [false] if it |
| 142 * bailed out. In the former case, [assignments] holds a list of | 142 * bailed out. In the former case, [assignments] holds a list of |
| 143 * [TypeInformation] nodes that flow into the element type of this list. | 143 * [TypeInformation] nodes that flow into the element type of this list. |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 callsGrowableMethod = true; | 205 callsGrowableMethod = true; |
| 206 assignments.add(inferrer.types.nullType); | 206 assignments.add(inferrer.types.nullType); |
| 207 } | 207 } |
| 208 } else if (selector.isCall && | 208 } else if (selector.isCall && |
| 209 !info.targets.every((element) => element.isFunction)) { | 209 !info.targets.every((element) => element.isFunction)) { |
| 210 bailout('Passed to a closure'); | 210 bailout('Passed to a closure'); |
| 211 return; | 211 return; |
| 212 } | 212 } |
| 213 } | 213 } |
| 214 } | 214 } |
| OLD | NEW |