| 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;
|
| }
|
| }
|
|
|