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

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

Issue 12528008: Implement CHA through type mask and TypedSelector in the simple type inferrer. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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/types/types.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/types/types.dart (revision 19670)
+++ sdk/lib/_internal/compiler/implementation/types/types.dart (working copy)
@@ -29,6 +29,7 @@
TypeMask getReturnTypeOfElement(Element element);
TypeMask getTypeOfElement(Element element);
TypeMask getTypeOfNode(Element owner, Node node);
+ TypeMask getTypeOfSelector(Selector selector);
}
/**
@@ -76,7 +77,7 @@
}
/**
- * Return the (inferred) guaranteed concrete type of [element] or null.
+ * Return the (inferred) guaranteed type of [element] or null.
*/
TypeMask getGuaranteedTypeOfElement(Element element) {
return measure(() {
@@ -116,7 +117,7 @@
}
/**
- * Return the (inferred) guaranteed concrete type of [node] or null.
+ * Return the (inferred) guaranteed type of [node] or null.
* [node] must be an AST node of [owner].
*/
TypeMask getGuaranteedTypeOfNode(owner, node) {
@@ -127,6 +128,19 @@
return null;
});
}
+
+ /**
+ * Return the (inferred) guaranteed type of [selector] or null.
+ * [node] must be an AST node of [owner].
+ */
+ TypeMask getGuaranteedTypeOfSelector(Selector selector) {
+ return measure(() {
+ if (typesInferrer != null) {
+ return typesInferrer.getTypeOfSelector(selector);
+ }
+ return null;
+ });
+ }
}
/**
@@ -146,12 +160,12 @@
ConcreteTypeInferencer(TypesTask task, this.elements)
: this.task = task,
- this.boolClass = task.compiler.boolClass,
- this.doubleClass = task.compiler.doubleClass,
- this.intClass = task.compiler.intClass,
- this.listClass = task.compiler.listClass,
- this.nullClass = task.compiler.nullClass,
- this.stringClass = task.compiler.stringClass,
+ this.boolClass = task.compiler.backend.boolImplementation,
+ this.doubleClass = task.compiler.backend.doubleImplementation,
+ this.intClass = task.compiler.backend.intImplementation,
+ this.listClass = task.compiler.backend.listImplementation,
+ this.nullClass = task.compiler.backend.nullImplementation,
+ this.stringClass = task.compiler.backend.stringImplementation,
this.concreteTypes = new Map<Node, ClassElement>();
visitNode(Node node) => node.visitChildren(this);

Powered by Google App Engine
This is Rietveld 408576698