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

Unified Diff: pkg/compiler/lib/src/types/types.dart

Issue 1777393003: Type inference cleanup (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 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
« no previous file with comments | « pkg/compiler/lib/src/inferrer/type_graph_nodes.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/types/types.dart
diff --git a/pkg/compiler/lib/src/types/types.dart b/pkg/compiler/lib/src/types/types.dart
index b9e5969e54c0adfd51a80d3edb39b7fbc534bd99..665d144ecb6e59d72ecfdbc73818b7586793bc7b 100644
--- a/pkg/compiler/lib/src/types/types.dart
+++ b/pkg/compiler/lib/src/types/types.dart
@@ -58,9 +58,6 @@ abstract class TypesInferrer {
* The types task infers guaranteed types globally.
*/
class TypesTask extends CompilerTask {
- static final bool DUMP_BAD_CPA_RESULTS = false;
- static final bool DUMP_GOOD_CPA_RESULTS = false;
-
final String name = 'Type inference';
final ClassWorld classWorld;
TypesInferrer typesInferrer;
@@ -280,12 +277,6 @@ class TypesTask extends CompilerTask {
/** Computes the intersection of [type1] and [type2] */
TypeMask intersection(TypeMask type1, TypeMask type2, element) {
TypeMask result = _intersection(type1, type2);
- if (DUMP_BAD_CPA_RESULTS && better(type1, type2)) {
- print("CPA is worse for $element: $type1 /\\ $type2 = $result");
- }
- if (DUMP_GOOD_CPA_RESULTS && better(type2, type1)) {
- print("CPA is better for $element: $type1 /\\ $type2 = $result");
- }
return result;
}
@@ -307,35 +298,31 @@ class TypesTask extends CompilerTask {
void onResolutionComplete(Element mainElement) {
measure(() {
typesInferrer.analyzeMain(mainElement);
+ typesInferrer.clear();
});
- typesInferrer.clear();
}
/**
* Return the (inferred) guaranteed type of [element] or null.
*/
TypeMask getGuaranteedTypeOfElement(Element element) {
- return measure(() {
- // TODO(24489): trust some JsInterop types.
- if (compiler.backend.isJsInterop(element)) {
- return dynamicType;
- }
- TypeMask guaranteedType = typesInferrer.getTypeOfElement(element);
- return guaranteedType;
- });
+ // TODO(24489): trust some JsInterop types.
+ if (compiler.backend.isJsInterop(element)) {
+ return dynamicType;
+ }
+ TypeMask guaranteedType = typesInferrer.getTypeOfElement(element);
+ return guaranteedType;
}
TypeMask getGuaranteedReturnTypeOfElement(Element element) {
- return measure(() {
- // TODO(24489): trust some JsInterop types.
- if (compiler.backend.isJsInterop(element)) {
- return dynamicType;
- }
-
- TypeMask guaranteedType =
- typesInferrer.getReturnTypeOfElement(element);
- return guaranteedType;
- });
+ // TODO(24489): trust some JsInterop types.
+ if (compiler.backend.isJsInterop(element)) {
+ return dynamicType;
+ }
+
+ TypeMask guaranteedType =
+ typesInferrer.getReturnTypeOfElement(element);
+ return guaranteedType;
}
/**
@@ -343,20 +330,16 @@ class TypesTask extends CompilerTask {
* [node] must be an AST node of [owner].
*/
TypeMask getGuaranteedTypeOfNode(owner, node) {
- return measure(() {
- TypeMask guaranteedType = typesInferrer.getTypeOfNode(owner, node);
- return guaranteedType;
- });
+ TypeMask guaranteedType = typesInferrer.getTypeOfNode(owner, node);
+ return guaranteedType;
}
/**
* Return the (inferred) guaranteed type of [selector] or null.
*/
TypeMask getGuaranteedTypeOfSelector(Selector selector, TypeMask mask) {
- return measure(() {
- TypeMask guaranteedType =
- typesInferrer.getTypeOfSelector(selector, mask);
- return guaranteedType;
- });
+ TypeMask guaranteedType =
+ typesInferrer.getTypeOfSelector(selector, mask);
+ return guaranteedType;
}
}
« no previous file with comments | « pkg/compiler/lib/src/inferrer/type_graph_nodes.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698