| 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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 bool isClosure(Element element) { | 264 bool isClosure(Element element) { |
| 265 if (!element.isFunction()) return false; | 265 if (!element.isFunction()) return false; |
| 266 Element outermost = element.getOutermostEnclosingMemberOrTopLevel(); | 266 Element outermost = element.getOutermostEnclosingMemberOrTopLevel(); |
| 267 return outermost.declaration != element.declaration; | 267 return outermost.declaration != element.declaration; |
| 268 } | 268 } |
| 269 | 269 |
| 270 visitElementTypeInformation(ElementTypeInformation info) { | 270 visitElementTypeInformation(ElementTypeInformation info) { |
| 271 if (isClosure(info.element)) { | 271 if (isClosure(info.element)) { |
| 272 bailout('Returned from a closure'); | 272 bailout('Returned from a closure'); |
| 273 } | 273 } |
| 274 if (compiler.backend.isNeededForReflection(info.element)) { |
| 275 bailout('Escape in reflection'); |
| 276 } |
| 274 } | 277 } |
| 275 } | 278 } |
| OLD | NEW |