| 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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 // TODO(herhut): Handle creation of closures from instances of Function. | 358 // TODO(herhut): Handle creation of closures from instances of Function. |
| 359 if (element.isInstanceMember && | 359 if (element.isInstanceMember && |
| 360 element.name == Compiler.CALL_OPERATOR_NAME) { | 360 element.name == Compiler.CALL_OPERATOR_NAME) { |
| 361 return true; | 361 return true; |
| 362 } | 362 } |
| 363 Element outermost = element.outermostEnclosingMemberOrTopLevel; | 363 Element outermost = element.outermostEnclosingMemberOrTopLevel; |
| 364 return outermost.declaration != element.declaration; | 364 return outermost.declaration != element.declaration; |
| 365 } | 365 } |
| 366 | 366 |
| 367 void visitMemberTypeInformation(MemberTypeInformation info) { | 367 void visitMemberTypeInformation(MemberTypeInformation info) { |
| 368 Element element = info.element; | |
| 369 if (info.isClosurized) { | 368 if (info.isClosurized) { |
| 370 bailout('Returned from a closurized method'); | 369 bailout('Returned from a closurized method'); |
| 371 } | 370 } |
| 372 if (isClosure(info.element)) { | 371 if (isClosure(info.element)) { |
| 373 bailout('Returned from a closure'); | 372 bailout('Returned from a closure'); |
| 374 } | 373 } |
| 375 if (!inferrer.compiler.backend | 374 if (!inferrer.compiler.backend |
| 376 .canBeUsedForGlobalOptimizations(info.element)) { | 375 .canBeUsedForGlobalOptimizations(info.element)) { |
| 377 bailout('Escape to code that has special backend treatment'); | 376 bailout('Escape to code that has special backend treatment'); |
| 378 } | 377 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 390 } | 389 } |
| 391 if (isParameterOfListAddingMethod(info.element) || | 390 if (isParameterOfListAddingMethod(info.element) || |
| 392 isParameterOfMapAddingMethod(info.element)) { | 391 isParameterOfMapAddingMethod(info.element)) { |
| 393 // These elements are being handled in | 392 // These elements are being handled in |
| 394 // [visitDynamicCallSiteTypeInformation]. | 393 // [visitDynamicCallSiteTypeInformation]. |
| 395 return; | 394 return; |
| 396 } | 395 } |
| 397 addNewEscapeInformation(info); | 396 addNewEscapeInformation(info); |
| 398 } | 397 } |
| 399 } | 398 } |
| OLD | NEW |