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

Side by Side Diff: lib/compiler/implementation/universe.dart

Issue 10908068: Better tracking of provided types at call sites (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase again Created 8 years, 3 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 class Universe { 5 class Universe {
6 Map<Element, CodeBuffer> generatedCode; 6 Map<Element, CodeBuffer> generatedCode;
7 Map<Element, CodeBuffer> generatedBailoutCode; 7 Map<Element, CodeBuffer> generatedBailoutCode;
8 final Set<ClassElement> instantiatedClasses; 8 final Set<ClassElement> instantiatedClasses;
9 final Set<SourceString> instantiatedClassInstanceFields; 9 final Set<SourceString> instantiatedClassInstanceFields;
10 final Set<FunctionElement> staticFunctionsNeedingGetter; 10 final Set<FunctionElement> staticFunctionsNeedingGetter;
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 if (namedArguments.isEmpty()) return namedArguments; 315 if (namedArguments.isEmpty()) return namedArguments;
316 if (!orderedNamedArguments.isEmpty()) return orderedNamedArguments; 316 if (!orderedNamedArguments.isEmpty()) return orderedNamedArguments;
317 317
318 orderedNamedArguments.addAll(namedArguments); 318 orderedNamedArguments.addAll(namedArguments);
319 orderedNamedArguments.sort((SourceString first, SourceString second) { 319 orderedNamedArguments.sort((SourceString first, SourceString second) {
320 return first.slowToString().compareTo(second.slowToString()); 320 return first.slowToString().compareTo(second.slowToString());
321 }); 321 });
322 return orderedNamedArguments; 322 return orderedNamedArguments;
323 } 323 }
324 324
325 toString() => 'Selector($kind, $name, $argumentCount)'; 325 String namedArgumentsToString() {
326 if (namedArgumentCount > 0) {
327 StringBuffer result = new StringBuffer();
328 for (int i = 0; i < namedArgumentCount; i++) {
329 if (i != 0) result.add(', ');
330 result.add(namedArguments[i].slowToString());
331 }
332 return "[$result]";
333 }
334 return '';
335 }
336
337 String toString() {
338 String named = '';
339 String type = '';
340 if (namedArgumentCount > 0) named = ', named=${namedArgumentsToString()}';
341 if (receiverType != null) type = ', type=$receiverType';
342 return 'Selector($kind, ${name.slowToString()}, '
343 'arity=$argumentCount$named$type)';
344 }
326 } 345 }
327 346
328 class TypedSelector extends Selector { 347 class TypedSelector extends Selector {
329 /** 348 /**
330 * The type of the receiver. Any subtype of that type can be the 349 * The type of the receiver. Any subtype of that type can be the
331 * target of the invocation. 350 * target of the invocation.
332 */ 351 */
333 final DartType receiverType; 352 final DartType receiverType;
334 353
335 TypedSelector(this.receiverType, Selector selector) 354 TypedSelector(this.receiverType, Selector selector)
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 } 399 }
381 400
382 if (!self.isInterface() && self.isSubclassOf(other)) { 401 if (!self.isInterface() && self.isSubclassOf(other)) {
383 // Resolve an invocation of [element.name] on [self]. If it 402 // Resolve an invocation of [element.name] on [self]. If it
384 // is found, this selector is a candidate. 403 // is found, this selector is a candidate.
385 return hasElementIn(self, element) && appliesUntyped(element, compiler); 404 return hasElementIn(self, element) && appliesUntyped(element, compiler);
386 } 405 }
387 406
388 return false; 407 return false;
389 } 408 }
390
391 toString() {
392 return 'Selector($kind, "${name.slowToString()}", '
393 '$argumentCount, type=$receiverType)';
394 }
395 } 409 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/ssa/builder.dart ('k') | tests/compiler/dart2js/backend_htype_list_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698