| 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.closure_tracer; | 5 library compiler.src.inferrer.closure_tracer; |
| 6 | 6 |
| 7 import '../common/names.dart' show Names; | 7 import '../common/names.dart' show Names; |
| 8 import '../elements/elements.dart'; | 8 import '../elements/elements.dart'; |
| 9 import '../elements/entities.dart'; | 9 import '../elements/entities.dart'; |
| 10 import '../js_backend/backend.dart' show JavaScriptBackend; | 10 import '../js_backend/backend.dart' show JavaScriptBackend; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 } | 77 } |
| 78 } | 78 } |
| 79 | 79 |
| 80 @override | 80 @override |
| 81 visitStaticCallSiteTypeInformation(StaticCallSiteTypeInformation info) { | 81 visitStaticCallSiteTypeInformation(StaticCallSiteTypeInformation info) { |
| 82 super.visitStaticCallSiteTypeInformation(info); | 82 super.visitStaticCallSiteTypeInformation(info); |
| 83 MemberEntity called = info.calledElement; | 83 MemberEntity called = info.calledElement; |
| 84 if (inferrer.closedWorld.commonElements.isForeign(called)) { | 84 if (inferrer.closedWorld.commonElements.isForeign(called)) { |
| 85 String name = called.name; | 85 String name = called.name; |
| 86 if (name == JavaScriptBackend.JS || name == 'DART_CLOSURE_TO_JS') { | 86 if (name == JavaScriptBackend.JS || name == 'DART_CLOSURE_TO_JS') { |
| 87 bailout('Used in JS ${info.call}'); | 87 bailout('Used in JS ${info.debugName}'); |
| 88 } | 88 } |
| 89 } | 89 } |
| 90 if (called.isGetter && | 90 if (called.isGetter && |
| 91 info.selector != null && | 91 info.selector != null && |
| 92 info.selector.isCall && | 92 info.selector.isCall && |
| 93 inferrer.types.getInferredTypeOfMember(called) == currentUser) { | 93 inferrer.types.getInferredTypeOfMember(called) == currentUser) { |
| 94 // This node can be a closure call as well. For example, `foo()` | 94 // This node can be a closure call as well. For example, `foo()` |
| 95 // where `foo` is a getter. | 95 // where `foo` is a getter. |
| 96 _registerCallForLaterAnalysis(info); | 96 _registerCallForLaterAnalysis(info); |
| 97 } | 97 } |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 @override | 139 @override |
| 140 visitStaticCallSiteTypeInformation(StaticCallSiteTypeInformation info) { | 140 visitStaticCallSiteTypeInformation(StaticCallSiteTypeInformation info) { |
| 141 super.visitStaticCallSiteTypeInformation(info); | 141 super.visitStaticCallSiteTypeInformation(info); |
| 142 if (info.calledElement == tracedElements.first && | 142 if (info.calledElement == tracedElements.first && |
| 143 info.selector != null && | 143 info.selector != null && |
| 144 info.selector.isGetter) { | 144 info.selector.isGetter) { |
| 145 addNewEscapeInformation(info); | 145 addNewEscapeInformation(info); |
| 146 } | 146 } |
| 147 } | 147 } |
| 148 } | 148 } |
| OLD | NEW |