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

Unified Diff: sdk/lib/_internal/compiler/implementation/resolution/members.dart

Issue 23819039: Create type masks lazily. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/resolution/members.dart
diff --git a/sdk/lib/_internal/compiler/implementation/resolution/members.dart b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
index 4c02eca9b8998a1f1ee40a51c97d0244820ecee6..7f8fe79a6d11c4efa8f5d72d6f49e697d26b5b13 100644
--- a/sdk/lib/_internal/compiler/implementation/resolution/members.dart
+++ b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
@@ -26,6 +26,14 @@ abstract class TreeElements {
Selector setMoveNextSelector(ForIn node, Selector selector);
Selector setCurrentSelector(ForIn node, Selector selector);
+ /**
+ * Returns [:true:] if [node] is a type literal.
+ *
+ * Resolution marks this by setting the type on the node to be the
+ * [:Type:] type.
+ */
+ bool isTypeLiteral(Send node);
+
/// Register additional dependencies required by [currentElement].
/// For example, elements that are used by a backend.
void registerDependency(Element element);
@@ -132,6 +140,10 @@ class TreeElementMapping implements TreeElements {
return selectors[node.inToken];
}
+ bool isTypeLiteral(Send node) {
+ return getType(node) != null;
+ }
+
void registerDependency(Element element) {
otherDependencies.add(element.implementation);
}
@@ -2310,7 +2322,7 @@ class ResolverVisitor extends MappingVisitor<Element> {
// Set the type of the node to [Type] to mark this send as a
// type variable expression.
mapping.setType(node, compiler.typeClass.computeType(compiler));
- world.registerInstantiatedClass(compiler.typeClass, mapping);
+ world.registerTypeLiteral(target, mapping);
} else if (target.impliesType() && !sendIsMemberAccess) {
// Set the type of the node to [Type] to mark this send as a
// type literal.
@@ -2474,8 +2486,10 @@ class ResolverVisitor extends MappingVisitor<Element> {
}
if (identical(source, '++')) {
registerBinaryOperator(const SourceString('+'));
+ world.registerInstantiatedClass(compiler.intClass, mapping);
} else if (identical(source, '--')) {
registerBinaryOperator(const SourceString('-'));
+ world.registerInstantiatedClass(compiler.intClass, mapping);
} else if (source.endsWith('=')) {
registerBinaryOperator(Elements.mapToUserOperator(operatorName));
}

Powered by Google App Engine
This is Rietveld 408576698