| 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 /** | 7 /** |
| 8 * A set of selector names that [List] implements, that we know do not | 8 * A set of selector names that [List] implements, that we know do not |
| 9 * change the element type of the list, or let the list escape to code | 9 * change the element type of the list, or let the list escape to code |
| 10 * that might change the element type. | 10 * that might change the element type. |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 if (element.getEnclosingClass() != compiler.backend.listImplementation) { | 381 if (element.getEnclosingClass() != compiler.backend.listImplementation) { |
| 382 return false; | 382 return false; |
| 383 } | 383 } |
| 384 Element method = element.enclosingElement; | 384 Element method = element.enclosingElement; |
| 385 return (method.name == '[]=') | 385 return (method.name == '[]=') |
| 386 || (method.name == 'add') | 386 || (method.name == 'add') |
| 387 || (method.name == 'insert'); | 387 || (method.name == 'insert'); |
| 388 } | 388 } |
| 389 | 389 |
| 390 visitElementTypeInformation(ElementTypeInformation info) { | 390 visitElementTypeInformation(ElementTypeInformation info) { |
| 391 if (info.isClosurized()) { |
| 392 bailout('Returned from a closurized method'); |
| 393 } |
| 391 if (isClosure(info.element)) { | 394 if (isClosure(info.element)) { |
| 392 bailout('Returned from a closure'); | 395 bailout('Returned from a closure'); |
| 393 } | 396 } |
| 394 if (compiler.backend.isNeededForReflection(info.element)) { | 397 if (compiler.backend.isNeededForReflection(info.element)) { |
| 395 bailout('Escape in reflection'); | 398 bailout('Escape in reflection'); |
| 396 } | 399 } |
| 397 if (isParameterOfListAddingMethod(info.element)) { | 400 if (isParameterOfListAddingMethod(info.element)) { |
| 398 // These elements are being handled in | 401 // These elements are being handled in |
| 399 // [visitDynamicCallSiteTypeInformation]. | 402 // [visitDynamicCallSiteTypeInformation]. |
| 400 return; | 403 return; |
| 401 } | 404 } |
| 402 addNewEscapeInformation(info); | 405 addNewEscapeInformation(info); |
| 403 } | 406 } |
| 404 } | 407 } |
| OLD | NEW |