OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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.map_tracer; | 5 library compiler.src.inferrer.map_tracer; |
6 | 6 |
7 import '../elements/elements.dart'; | 7 import '../elements/elements.dart'; |
8 import '../js_backend/backend.dart' show JavaScriptBackend; | 8 import '../js_backend/backend.dart' show JavaScriptBackend; |
9 import '../universe/selector.dart' show Selector; | 9 import '../universe/selector.dart' show Selector; |
10 import 'node_tracer.dart'; | 10 import 'node_tracer.dart'; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 return false; | 60 return false; |
61 } | 61 } |
62 | 62 |
63 visitClosureCallSiteTypeInformation(ClosureCallSiteTypeInformation info) { | 63 visitClosureCallSiteTypeInformation(ClosureCallSiteTypeInformation info) { |
64 bailout('Passed to a closure'); | 64 bailout('Passed to a closure'); |
65 } | 65 } |
66 | 66 |
67 visitStaticCallSiteTypeInformation(StaticCallSiteTypeInformation info) { | 67 visitStaticCallSiteTypeInformation(StaticCallSiteTypeInformation info) { |
68 super.visitStaticCallSiteTypeInformation(info); | 68 super.visitStaticCallSiteTypeInformation(info); |
69 Element called = info.calledElement; | 69 Element called = info.calledElement; |
70 if (compiler.backend.isForeign(compiler.commonElements, called) && | 70 if (compiler.backend |
| 71 .isForeign(inferrer.closedWorld.commonElements, called) && |
71 called.name == JavaScriptBackend.JS) { | 72 called.name == JavaScriptBackend.JS) { |
72 bailout('Used in JS ${info.call}'); | 73 bailout('Used in JS ${info.call}'); |
73 } | 74 } |
74 } | 75 } |
75 | 76 |
76 visitDynamicCallSiteTypeInformation(DynamicCallSiteTypeInformation info) { | 77 visitDynamicCallSiteTypeInformation(DynamicCallSiteTypeInformation info) { |
77 super.visitDynamicCallSiteTypeInformation(info); | 78 super.visitDynamicCallSiteTypeInformation(info); |
78 Selector selector = info.selector; | 79 Selector selector = info.selector; |
79 String selectorName = selector.name; | 80 String selectorName = selector.name; |
80 if (currentUser == info.receiver) { | 81 if (currentUser == info.receiver) { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 return; | 122 return; |
122 } | 123 } |
123 } | 124 } |
124 } else if (selector.isCall && | 125 } else if (selector.isCall && |
125 !info.targets.every((element) => element.isFunction)) { | 126 !info.targets.every((element) => element.isFunction)) { |
126 bailout('Passed to a closure'); | 127 bailout('Passed to a closure'); |
127 return; | 128 return; |
128 } | 129 } |
129 } | 130 } |
130 } | 131 } |
OLD | NEW |