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

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

Issue 49813002: Infer types for parameters even in the presence of InvocationMirror.delegate. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/codegen.dart ('k') | no next file » | 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) 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 library universe; 5 library universe;
6 6
7 import '../elements/elements.dart'; 7 import '../elements/elements.dart';
8 import '../dart2jslib.dart'; 8 import '../dart2jslib.dart';
9 import '../dart_types.dart'; 9 import '../dart_types.dart';
10 import '../types/types.dart'; 10 import '../types/types.dart';
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 } 588 }
589 589
590 String toString() { 590 String toString() {
591 String named = ''; 591 String named = '';
592 String type = ''; 592 String type = '';
593 if (namedArgumentCount > 0) named = ', named=${namedArgumentsToString()}'; 593 if (namedArgumentCount > 0) named = ', named=${namedArgumentsToString()}';
594 if (mask != null) type = ', mask=$mask'; 594 if (mask != null) type = ', mask=$mask';
595 return 'Selector($kind, $name, ' 595 return 'Selector($kind, $name, '
596 'arity=$argumentCount$named$type)'; 596 'arity=$argumentCount$named$type)';
597 } 597 }
598
599 Selector extendIfReachesAll(Compiler compiler) {
600 return new TypedSelector(compiler.typesTask.dynamicType, this);
601 }
598 } 602 }
599 603
600 class TypedSelector extends Selector { 604 class TypedSelector extends Selector {
601 final Selector asUntyped; 605 final Selector asUntyped;
602 final TypeMask mask; 606 final TypeMask mask;
603 607
604 TypedSelector.internal(this.mask, Selector selector, int hashCode) 608 TypedSelector.internal(this.mask, Selector selector, int hashCode)
605 : asUntyped = selector, 609 : asUntyped = selector,
606 super.internal(selector.kind, 610 super.internal(selector.kind,
607 selector.name, 611 selector.name,
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 // get foo => () => 42; 653 // get foo => () => 42;
650 // bar() => foo(); // The call to 'foo' is a typed selector. 654 // bar() => foo(); // The call to 'foo' is a typed selector.
651 // } 655 // }
652 if (element.getEnclosingClass().isClosure()) { 656 if (element.getEnclosingClass().isClosure()) {
653 return appliesUntyped(element, compiler); 657 return appliesUntyped(element, compiler);
654 } 658 }
655 659
656 if (!mask.canHit(element, this, compiler)) return false; 660 if (!mask.canHit(element, this, compiler)) return false;
657 return appliesUntyped(element, compiler); 661 return appliesUntyped(element, compiler);
658 } 662 }
663
664 Selector extendIfReachesAll(Compiler compiler) {
665 bool canReachAll = compiler.enabledInvokeOn
666 && mask.needsNoSuchMethodHandling(this, compiler);
667 return canReachAll
668 ? new TypedSelector(compiler.typesTask.dynamicType, this)
669 : this;
670 }
659 } 671 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/codegen.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698