| 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.node_tracer; | 5 library compiler.src.inferrer.node_tracer; |
| 6 | 6 |
| 7 import '../common/names.dart' show Identifiers; | 7 import '../common/names.dart' show Identifiers; |
| 8 import '../compiler.dart' show Compiler; | 8 import '../compiler.dart' show Compiler; |
| 9 import '../elements/elements.dart'; | 9 import '../elements/elements.dart'; |
| 10 import '../types/types.dart' show ContainerTypeMask, MapTypeMask; | 10 import '../types/types.dart' show ContainerTypeMask, MapTypeMask; |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 addNewEscapeInformation(info); | 326 addNewEscapeInformation(info); |
| 327 } | 327 } |
| 328 } | 328 } |
| 329 | 329 |
| 330 /** | 330 /** |
| 331 * Check whether element is the parameter of a list adding method. | 331 * Check whether element is the parameter of a list adding method. |
| 332 * The definition of what a list adding method is has to stay in sync with | 332 * The definition of what a list adding method is has to stay in sync with |
| 333 * [isAddedToContainer]. | 333 * [isAddedToContainer]. |
| 334 */ | 334 */ |
| 335 bool isParameterOfListAddingMethod(Element element) { | 335 bool isParameterOfListAddingMethod(Element element) { |
| 336 if (!element.isParameter) return false; | 336 if (!element.isRegularParameter) return false; |
| 337 if (element.enclosingClass != compiler.backend.listImplementation) { | 337 if (element.enclosingClass != compiler.backend.listImplementation) { |
| 338 return false; | 338 return false; |
| 339 } | 339 } |
| 340 Element method = element.enclosingElement; | 340 Element method = element.enclosingElement; |
| 341 return (method.name == '[]=') || | 341 return (method.name == '[]=') || |
| 342 (method.name == 'add') || | 342 (method.name == 'add') || |
| 343 (method.name == 'insert'); | 343 (method.name == 'insert'); |
| 344 } | 344 } |
| 345 | 345 |
| 346 /** | 346 /** |
| 347 * Check whether element is the parameter of a list adding method. | 347 * Check whether element is the parameter of a list adding method. |
| 348 * The definition of what a list adding method is has to stay in sync with | 348 * The definition of what a list adding method is has to stay in sync with |
| 349 * [isValueAddedToMap] and [isKeyAddedToMap]. | 349 * [isValueAddedToMap] and [isKeyAddedToMap]. |
| 350 */ | 350 */ |
| 351 bool isParameterOfMapAddingMethod(Element element) { | 351 bool isParameterOfMapAddingMethod(Element element) { |
| 352 if (!element.isParameter) return false; | 352 if (!element.isRegularParameter) return false; |
| 353 if (element.enclosingClass != compiler.backend.mapImplementation) { | 353 if (element.enclosingClass != compiler.backend.mapImplementation) { |
| 354 return false; | 354 return false; |
| 355 } | 355 } |
| 356 Element method = element.enclosingElement; | 356 Element method = element.enclosingElement; |
| 357 return (method.name == '[]='); | 357 return (method.name == '[]='); |
| 358 } | 358 } |
| 359 | 359 |
| 360 bool isClosure(Element element) { | 360 bool isClosure(Element element) { |
| 361 if (!element.isFunction) return false; | 361 if (!element.isFunction) return false; |
| 362 | 362 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 } | 397 } |
| 398 if (isParameterOfListAddingMethod(info.element) || | 398 if (isParameterOfListAddingMethod(info.element) || |
| 399 isParameterOfMapAddingMethod(info.element)) { | 399 isParameterOfMapAddingMethod(info.element)) { |
| 400 // These elements are being handled in | 400 // These elements are being handled in |
| 401 // [visitDynamicCallSiteTypeInformation]. | 401 // [visitDynamicCallSiteTypeInformation]. |
| 402 return; | 402 return; |
| 403 } | 403 } |
| 404 addNewEscapeInformation(info); | 404 addNewEscapeInformation(info); |
| 405 } | 405 } |
| 406 } | 406 } |
| OLD | NEW |