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

Unified Diff: sdk/lib/_internal/compiler/implementation/universe/universe.dart

Issue 12334070: Support runtime check of function types. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Minor fix Created 7 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/universe/universe.dart
diff --git a/sdk/lib/_internal/compiler/implementation/universe/universe.dart b/sdk/lib/_internal/compiler/implementation/universe/universe.dart
index ae3b54b4f93250132e282f297243a795d101f9b0..bb558012d3d1320a5610cc92044c61a2e0a2b947 100644
--- a/sdk/lib/_internal/compiler/implementation/universe/universe.dart
+++ b/sdk/lib/_internal/compiler/implementation/universe/universe.dart
@@ -50,6 +50,20 @@ class Universe {
final Set<Element> fieldSetters;
final Set<DartType> isChecks;
+ /**
+ * Set of [:call:] methods in instantiated classes that use type variables
+ * in their signature.
+ */
+ final Set<Element> genericCallMethods;
+
+ /**
+ * Set of methods in instantiated classes that use type variables in their
+ * signature and have potentially been closurized.
+ */
+ final Set<Element> closurizedGenericMembers;
+
+ final Set<Element> closurizedMembers;
+
bool usingFactoryWithTypeArguments = false;
Universe() : instantiatedClasses = new Set<ClassElement>(),
@@ -60,7 +74,10 @@ class Universe {
invokedSetters = new Map<SourceString, Set<Selector>>(),
fieldGetters = new Set<Element>(),
fieldSetters = new Set<Element>(),
- isChecks = new Set<DartType>();
+ isChecks = new Set<DartType>(),
+ genericCallMethods = new Set<Element>(),
+ closurizedGenericMembers = new Set<Element>(),
+ closurizedMembers = new Set<Element>();
bool hasMatchingSelector(Set<Selector> selectors,
Element member,
@@ -91,6 +108,15 @@ class Universe {
bool hasFieldSetter(Element member, Compiler compiler) {
return fieldSetters.contains(member);
}
+
+ DartType registerIsCheck(DartType type, Compiler compiler) {
+ type = type.unalias(compiler);
+ // Even in checked mode, type annotations for return type and argument
+ // types do not imply type checks, so there should never be a check
+ // against the type variable of a typedef.
+ isChecks.add(type);
+ return type;
+ }
}
class SelectorKind {

Powered by Google App Engine
This is Rietveld 408576698