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

Side by Side Diff: pkg/compiler/lib/src/inferrer/map_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) 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_helpers.dart';
8 import '../universe/selector.dart' show Selector; 9 import '../universe/selector.dart' show Selector;
9 import 'node_tracer.dart'; 10 import 'node_tracer.dart';
10 import 'type_graph_nodes.dart'; 11 import 'type_graph_nodes.dart';
11 12
12 Set<String> okMapSelectorsSet = new Set.from(const <String>[ 13 Set<String> okMapSelectorsSet = new Set.from(const <String>[
13 // From Object. 14 // From Object.
14 "==", 15 "==",
15 "hashCode", 16 "hashCode",
16 "toString", 17 "toString",
17 "noSuchMethod", 18 "noSuchMethod",
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 return false; 60 return false;
60 } 61 }
61 62
62 visitClosureCallSiteTypeInformation(ClosureCallSiteTypeInformation info) { 63 visitClosureCallSiteTypeInformation(ClosureCallSiteTypeInformation info) {
63 bailout('Passed to a closure'); 64 bailout('Passed to a closure');
64 } 65 }
65 66
66 visitStaticCallSiteTypeInformation(StaticCallSiteTypeInformation info) { 67 visitStaticCallSiteTypeInformation(StaticCallSiteTypeInformation info) {
67 super.visitStaticCallSiteTypeInformation(info); 68 super.visitStaticCallSiteTypeInformation(info);
68 Element called = info.calledElement; 69 Element called = info.calledElement;
69 if (compiler.backend.isForeign(called) && called.name == 'JS') { 70 if (compiler.backend.isForeign(called) &&
71 called.name == BackendHelpers.JS) {
70 bailout('Used in JS ${info.call}'); 72 bailout('Used in JS ${info.call}');
71 } 73 }
72 } 74 }
73 75
74 visitDynamicCallSiteTypeInformation(DynamicCallSiteTypeInformation info) { 76 visitDynamicCallSiteTypeInformation(DynamicCallSiteTypeInformation info) {
75 super.visitDynamicCallSiteTypeInformation(info); 77 super.visitDynamicCallSiteTypeInformation(info);
76 Selector selector = info.selector; 78 Selector selector = info.selector;
77 String selectorName = selector.name; 79 String selectorName = selector.name;
78 if (currentUser == info.receiver) { 80 if (currentUser == info.receiver) {
79 if (!okMapSelectorsSet.contains(selectorName)) { 81 if (!okMapSelectorsSet.contains(selectorName)) {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 return; 121 return;
120 } 122 }
121 } 123 }
122 } else if (selector.isCall && 124 } else if (selector.isCall &&
123 !info.targets.every((element) => element.isFunction)) { 125 !info.targets.every((element) => element.isFunction)) {
124 bailout('Passed to a closure'); 126 bailout('Passed to a closure');
125 return; 127 return;
126 } 128 }
127 } 129 }
128 } 130 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/inferrer/list_tracer.dart ('k') | pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698