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

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

Issue 1020853007: Don't bailout of type inference for simple NSM implementations (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/inferrer/type_graph_nodes.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 part of type_graph_inferrer; 5 part of type_graph_inferrer;
6 6
7 // A set of selectors we know do not escape the elements inside the 7 // A set of selectors we know do not escape the elements inside the
8 // list. 8 // list.
9 Set<String> doesNotEscapeListSet = new Set<String>.from( 9 Set<String> doesNotEscapeListSet = new Set<String>.from(
10 const <String>[ 10 const <String>[
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 } else { 298 } else {
299 // The [MapTypeMask] is a union. See comment for 299 // The [MapTypeMask] is a union. See comment for
300 // [ContainerTypeMask] above. 300 // [ContainerTypeMask] above.
301 bailout('Stored in too many maps'); 301 bailout('Stored in too many maps');
302 } 302 }
303 } else if (isKeyAddedToMap(info)) { 303 } else if (isKeyAddedToMap(info)) {
304 // We do not track the use of keys from a map, so we have to bail. 304 // We do not track the use of keys from a map, so we have to bail.
305 bailout('Used as key in Map'); 305 bailout('Used as key in Map');
306 } 306 }
307 307
308 if (info.targetsIncludeNoSuchMethod && 308 if (info.targetsIncludeComplexNoSuchMethod(inferrer) &&
309 info.arguments != null && 309 info.arguments != null &&
310 info.arguments.contains(currentUser)) { 310 info.arguments.contains(currentUser)) {
311 bailout('Passed to noSuchMethod'); 311 bailout('Passed to noSuchMethod');
312 } 312 }
313 313
314 Iterable<Element> inferredTargetTypes = info.targets.map((element) { 314 Iterable<Element> inferredTargetTypes = info.targets.map((element) {
315 return inferrer.types.getInferredTypeOf(element); 315 return inferrer.types.getInferredTypeOf(element);
316 }); 316 });
317 if (inferredTargetTypes.any((user) => user == currentUser)) { 317 if (inferredTargetTypes.any((user) => user == currentUser)) {
318 addNewEscapeInformation(info); 318 addNewEscapeInformation(info);
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 } 390 }
391 if (isParameterOfListAddingMethod(info.element) || 391 if (isParameterOfListAddingMethod(info.element) ||
392 isParameterOfMapAddingMethod(info.element)) { 392 isParameterOfMapAddingMethod(info.element)) {
393 // These elements are being handled in 393 // These elements are being handled in
394 // [visitDynamicCallSiteTypeInformation]. 394 // [visitDynamicCallSiteTypeInformation].
395 return; 395 return;
396 } 396 }
397 addNewEscapeInformation(info); 397 addNewEscapeInformation(info);
398 } 398 }
399 } 399 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/inferrer/type_graph_nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698