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

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

Issue 2782583003: Extract the AST specific part of NoSuchMethodRegistry (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/js_backend/backend.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 library compiler.src.inferrer.type_graph_nodes; 5 library compiler.src.inferrer.type_graph_nodes;
6 6
7 import 'dart:collection' show IterableBase; 7 import 'dart:collection' show IterableBase;
8 8
9 import '../common.dart'; 9 import '../common.dart';
10 import '../common/names.dart' show Identifiers; 10 import '../common/names.dart' show Identifiers;
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 } else { 850 } else {
851 return mask; 851 return mask;
852 } 852 }
853 } 853 }
854 854
855 bool targetsIncludeComplexNoSuchMethod(InferrerEngine inferrer) { 855 bool targetsIncludeComplexNoSuchMethod(InferrerEngine inferrer) {
856 return targets.any((Element e) { 856 return targets.any((Element e) {
857 return e is FunctionElement && 857 return e is FunctionElement &&
858 e.isInstanceMember && 858 e.isInstanceMember &&
859 e.name == Identifiers.noSuchMethod_ && 859 e.name == Identifiers.noSuchMethod_ &&
860 inferrer.backend.isComplexNoSuchMethod(e); 860 inferrer.backend.noSuchMethodRegistry.isComplex(e);
861 }); 861 });
862 } 862 }
863 863
864 /** 864 /**
865 * We optimize certain operations on the [int] class because we know more 865 * We optimize certain operations on the [int] class because we know more
866 * about their return type than the actual Dart code. For example, we know int 866 * about their return type than the actual Dart code. For example, we know int
867 * + int returns an int. The Dart library code for [int.operator+] only says 867 * + int returns an int. The Dart library code for [int.operator+] only says
868 * it returns a [num]. 868 * it returns a [num].
869 * 869 *
870 * Returns the more precise TypeInformation, or `null` to defer to the library 870 * Returns the more precise TypeInformation, or `null` to defer to the library
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after
1743 } else if (annotation.isVoid) { 1743 } else if (annotation.isVoid) {
1744 otherType = closedWorld.commonMasks.nullType; 1744 otherType = closedWorld.commonMasks.nullType;
1745 } else { 1745 } else {
1746 ResolutionInterfaceType interfaceType = annotation; 1746 ResolutionInterfaceType interfaceType = annotation;
1747 otherType = new TypeMask.nonNullSubtype(interfaceType.element, closedWorld); 1747 otherType = new TypeMask.nonNullSubtype(interfaceType.element, closedWorld);
1748 } 1748 }
1749 if (isNullable) otherType = otherType.nullable(); 1749 if (isNullable) otherType = otherType.nullable();
1750 if (type == null) return otherType; 1750 if (type == null) return otherType;
1751 return type.intersection(otherType, closedWorld); 1751 return type.intersection(otherType, closedWorld);
1752 } 1752 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/js_backend/backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698