Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Side by Side Diff: pkg/compiler/lib/src/inferrer/list_tracer.dart

Issue 2467493003: Compute NativeBehavior for native methods and fields. (Closed)
Patch Set: Updated cf. comments Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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.list_tracer; 5 library compiler.src.inferrer.list_tracer;
6 6
7 import '../elements/elements.dart'; 7 import '../elements/elements.dart';
8 import '../js_backend/backend_helpers.dart';
8 import '../universe/selector.dart' show Selector; 9 import '../universe/selector.dart' show Selector;
9 import '../util/util.dart' show Setlet; 10 import '../util/util.dart' show Setlet;
10 import 'node_tracer.dart'; 11 import 'node_tracer.dart';
11 import 'type_graph_nodes.dart'; 12 import 'type_graph_nodes.dart';
12 13
13 /** 14 /**
14 * A set of selector names that [List] implements, that we know do not 15 * A set of selector names that [List] implements, that we know do not
15 * change the element type of the list, or let the list escape to code 16 * change the element type of the list, or let the list escape to code
16 * that might change the element type. 17 * that might change the element type.
17 */ 18 */
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 } 158 }
158 } 159 }
159 160
160 visitClosureCallSiteTypeInformation(ClosureCallSiteTypeInformation info) { 161 visitClosureCallSiteTypeInformation(ClosureCallSiteTypeInformation info) {
161 bailout('Passed to a closure'); 162 bailout('Passed to a closure');
162 } 163 }
163 164
164 visitStaticCallSiteTypeInformation(StaticCallSiteTypeInformation info) { 165 visitStaticCallSiteTypeInformation(StaticCallSiteTypeInformation info) {
165 super.visitStaticCallSiteTypeInformation(info); 166 super.visitStaticCallSiteTypeInformation(info);
166 Element called = info.calledElement; 167 Element called = info.calledElement;
167 if (compiler.backend.isForeign(called) && called.name == 'JS') { 168 if (compiler.backend.isForeign(called) &&
169 called.name == BackendHelpers.JS) {
168 bailout('Used in JS ${info.call}'); 170 bailout('Used in JS ${info.call}');
169 } 171 }
170 } 172 }
171 173
172 visitDynamicCallSiteTypeInformation(DynamicCallSiteTypeInformation info) { 174 visitDynamicCallSiteTypeInformation(DynamicCallSiteTypeInformation info) {
173 super.visitDynamicCallSiteTypeInformation(info); 175 super.visitDynamicCallSiteTypeInformation(info);
174 Selector selector = info.selector; 176 Selector selector = info.selector;
175 String selectorName = selector.name; 177 String selectorName = selector.name;
176 if (currentUser == info.receiver) { 178 if (currentUser == info.receiver) {
177 if (!okListSelectorsSet.contains(selectorName)) { 179 if (!okListSelectorsSet.contains(selectorName)) {
(...skipping 25 matching lines...) Expand all
203 callsGrowableMethod = true; 205 callsGrowableMethod = true;
204 assignments.add(inferrer.types.nullType); 206 assignments.add(inferrer.types.nullType);
205 } 207 }
206 } else if (selector.isCall && 208 } else if (selector.isCall &&
207 !info.targets.every((element) => element.isFunction)) { 209 !info.targets.every((element) => element.isFunction)) {
208 bailout('Passed to a closure'); 210 bailout('Passed to a closure');
209 return; 211 return;
210 } 212 }
211 } 213 }
212 } 214 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/inferrer/closure_tracer.dart ('k') | pkg/compiler/lib/src/inferrer/map_tracer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698