| 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 part of type_graph_inferrer; | 5 part of type_graph_inferrer; |
| 6 | 6 |
| 7 Set<String> okMapSelectorsSet = new Set.from( | 7 Set<String> okMapSelectorsSet = new Set.from( |
| 8 const <String>[ | 8 const <String>[ |
| 9 // From Object. | 9 // From Object. |
| 10 "==", | 10 "==", |
| 11 "hashCode", | 11 "hashCode", |
| 12 "toString", | 12 "toString", |
| 13 "noSuchMethod", | 13 "noSuchMethod", |
| 14 "runtimeType", | 14 "runtimeType", |
| 15 // From Map | 15 // From Map |
| 16 "[]", | 16 "[]", |
| 17 "isEmpty", | 17 "isEmpty", |
| 18 "isNotEmpty", | 18 "isNotEmpty", |
| 19 "keys", | 19 "keys", |
| 20 "length", | 20 "length", |
| 21 "values", | 21 "values", |
| 22 "clear", | 22 "clear", |
| 23 "containsKey", | 23 "containsKey", |
| 24 "containsValue", | 24 "containsValue", |
| 25 "forEach", | 25 "forEach", |
| 26 "remove"]); | 26 "remove"]); |
| 27 | 27 |
| 28 class MapTracerVisitor extends TracerVisitor { | 28 class MapTracerVisitor extends TracerVisitor<MapTypeInformation> { |
| 29 // These lists are used to keep track of newly discovered assignments to | 29 // These lists are used to keep track of newly discovered assignments to |
| 30 // the map. Note that elements at corresponding indices are expected to | 30 // the map. Note that elements at corresponding indices are expected to |
| 31 // belong to the same assignment operation. | 31 // belong to the same assignment operation. |
| 32 List<TypeInformation> keyAssignments = <TypeInformation>[]; | 32 List<TypeInformation> keyAssignments = <TypeInformation>[]; |
| 33 List<TypeInformation> valueAssignments = <TypeInformation>[]; | 33 List<TypeInformation> valueAssignments = <TypeInformation>[]; |
| 34 // This list is used to keep track of assignments of entire maps to | 34 // This list is used to keep track of assignments of entire maps to |
| 35 // this map. | 35 // this map. |
| 36 List<MapTypeInformation> mapAssignments = <MapTypeInformation>[]; | 36 List<MapTypeInformation> mapAssignments = <MapTypeInformation>[]; |
| 37 | 37 |
| 38 MapTracerVisitor(tracedType, inferrer) : super(tracedType, inferrer); | 38 MapTracerVisitor(tracedType, inferrer) : super(tracedType, inferrer); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 return; | 114 return; |
| 115 } | 115 } |
| 116 } | 116 } |
| 117 } else if (selector.isCall() && | 117 } else if (selector.isCall() && |
| 118 !info.targets.every((element) => element.isFunction())) { | 118 !info.targets.every((element) => element.isFunction())) { |
| 119 bailout('Passed to a closure'); | 119 bailout('Passed to a closure'); |
| 120 return; | 120 return; |
| 121 } | 121 } |
| 122 } | 122 } |
| 123 } | 123 } |
| OLD | NEW |