| 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 part of type_graph_inferrer; | 5 part of type_graph_inferrer; |
| 6 | 6 |
| 7 // A set of selectors we know do not escape the elements inside the | 7 // A set of selectors we know do not escape the elements inside the |
| 8 // list. | 8 // list. |
| 9 Set<String> doesNotEscapeListSet = new Set<String>.from( | 9 Set<String> doesNotEscapeListSet = new Set<String>.from( |
| 10 const <String>[ | 10 const <String>[ |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 } else { | 298 } else { |
| 299 // The [MapTypeMask] is a union. See comment for | 299 // The [MapTypeMask] is a union. See comment for |
| 300 // [ContainerTypeMask] above. | 300 // [ContainerTypeMask] above. |
| 301 bailout('Stored in too many maps'); | 301 bailout('Stored in too many maps'); |
| 302 } | 302 } |
| 303 } else if (isKeyAddedToMap(info)) { | 303 } else if (isKeyAddedToMap(info)) { |
| 304 // We do not track the use of keys from a map, so we have to bail. | 304 // We do not track the use of keys from a map, so we have to bail. |
| 305 bailout('Used as key in Map'); | 305 bailout('Used as key in Map'); |
| 306 } | 306 } |
| 307 | 307 |
| 308 if (info.targetsIncludeNoSuchMethod && | 308 if (info.targetsIncludeComplexNoSuchMethod(inferrer) && |
| 309 info.arguments != null && | 309 info.arguments != null && |
| 310 info.arguments.contains(currentUser)) { | 310 info.arguments.contains(currentUser)) { |
| 311 bailout('Passed to noSuchMethod'); | 311 bailout('Passed to noSuchMethod'); |
| 312 } | 312 } |
| 313 | 313 |
| 314 Iterable<Element> inferredTargetTypes = info.targets.map((element) { | 314 Iterable<Element> inferredTargetTypes = info.targets.map((element) { |
| 315 return inferrer.types.getInferredTypeOf(element); | 315 return inferrer.types.getInferredTypeOf(element); |
| 316 }); | 316 }); |
| 317 if (inferredTargetTypes.any((user) => user == currentUser)) { | 317 if (inferredTargetTypes.any((user) => user == currentUser)) { |
| 318 addNewEscapeInformation(info); | 318 addNewEscapeInformation(info); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 } | 390 } |
| 391 if (isParameterOfListAddingMethod(info.element) || | 391 if (isParameterOfListAddingMethod(info.element) || |
| 392 isParameterOfMapAddingMethod(info.element)) { | 392 isParameterOfMapAddingMethod(info.element)) { |
| 393 // These elements are being handled in | 393 // These elements are being handled in |
| 394 // [visitDynamicCallSiteTypeInformation]. | 394 // [visitDynamicCallSiteTypeInformation]. |
| 395 return; | 395 return; |
| 396 } | 396 } |
| 397 addNewEscapeInformation(info); | 397 addNewEscapeInformation(info); |
| 398 } | 398 } |
| 399 } | 399 } |
| OLD | NEW |