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

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

Issue 1173403002: dart2js: Fix hints in code base. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Updated to latest revision Created 5 years, 6 months 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 part of type_graph_inferrer; 5 part of type_graph_inferrer;
6 6
7 Set<String> okMapSelectorsSet = new Set.from( 7 Set<String> okMapSelectorsSet = new Set.from(
8 const <String>[ 8 const <String>[
9 // From Object. 9 // From Object.
10 "==", 10 "==",
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 } 66 }
67 } 67 }
68 68
69 visitDynamicCallSiteTypeInformation(DynamicCallSiteTypeInformation info) { 69 visitDynamicCallSiteTypeInformation(DynamicCallSiteTypeInformation info) {
70 super.visitDynamicCallSiteTypeInformation(info); 70 super.visitDynamicCallSiteTypeInformation(info);
71 Selector selector = info.selector; 71 Selector selector = info.selector;
72 String selectorName = selector.name; 72 String selectorName = selector.name;
73 if (currentUser == info.receiver) { 73 if (currentUser == info.receiver) {
74 if (!okMapSelectorsSet.contains(selectorName)) { 74 if (!okMapSelectorsSet.contains(selectorName)) {
75 if (selector.isCall) { 75 if (selector.isCall) {
76 int positionalLength = info.arguments.positional.length;
77 if (selectorName == 'addAll') { 76 if (selectorName == 'addAll') {
78 // All keys and values from the argument flow into 77 // All keys and values from the argument flow into
79 // the map. 78 // the map.
80 TypeInformation map = info.arguments.positional[0]; 79 TypeInformation map = info.arguments.positional[0];
81 if (map is MapTypeInformation) { 80 if (map is MapTypeInformation) {
82 inferrer.analyzeMapAndEnqueue(map); 81 inferrer.analyzeMapAndEnqueue(map);
83 mapAssignments.add(map); 82 mapAssignments.add(map);
84 } else { 83 } else {
85 // If we could select a component from a [TypeInformation], 84 // If we could select a component from a [TypeInformation],
86 // like the keytype or valuetype in this case, we could 85 // like the keytype or valuetype in this case, we could
(...skipping 28 matching lines...) Expand all
115 return; 114 return;
116 } 115 }
117 } 116 }
118 } else if (selector.isCall && 117 } else if (selector.isCall &&
119 !info.targets.every((element) => element.isFunction)) { 118 !info.targets.every((element) => element.isFunction)) {
120 bailout('Passed to a closure'); 119 bailout('Passed to a closure');
121 return; 120 return;
122 } 121 }
123 } 122 }
124 } 123 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698