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

Unified Diff: pkg/compiler/lib/src/inferrer/inferrer_engine.dart

Issue 2746293006: Pulling the element model out of global type inference. (Closed)
Patch Set: . Created 3 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/builder_kernel.dart ('k') | pkg/compiler/lib/src/options.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/inferrer/inferrer_engine.dart
diff --git a/pkg/compiler/lib/src/inferrer/inferrer_engine.dart b/pkg/compiler/lib/src/inferrer/inferrer_engine.dart
index 96b198ed1c8dde97d49335970f41eb790a6ef259..cc50210b8725c14e9da5477091b3d94b95a6a368 100644
--- a/pkg/compiler/lib/src/inferrer/inferrer_engine.dart
+++ b/pkg/compiler/lib/src/inferrer/inferrer_engine.dart
@@ -2,6 +2,8 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+import 'package:kernel/ast.dart' as ir;
+
import '../common.dart';
import '../common/names.dart';
import '../compiler.dart';
@@ -28,6 +30,7 @@ import 'locals_handler.dart';
import 'list_tracer.dart';
import 'map_tracer.dart';
import 'builder.dart';
+import 'builder_kernel.dart';
import 'type_graph_dump.dart';
import 'type_graph_inferrer.dart';
import 'type_graph_nodes.dart';
@@ -64,6 +67,12 @@ class InferrerEngine {
final TypeSystem types;
final Map<ast.Node, TypeInformation> concreteTypes =
new Map<ast.Node, TypeInformation>();
+
+ /// Parallel structure for concreteTypes.
+ // TODO(efortuna): Remove concreteTypes and/or parameterize InferrerEngine by
+ // ir.Node or ast.Node type. Then remove this in favor of `concreteTypes`.
+ final Map<ir.Node, TypeInformation> concreteKernelTypes =
+ new Map<ir.Node, TypeInformation>();
final Set<Element> generativeConstructorsExposingThis = new Set<Element>();
/// Data computed internally within elements, like the type-mask of a send a
@@ -467,8 +476,9 @@ class InferrerEngine {
if (analyzedElements.contains(element)) return;
analyzedElements.add(element);
- ElementGraphBuilder visitor =
- new ElementGraphBuilder(element, resolvedAst, compiler, this);
+ var visitor = compiler.options.kernelGlobalInference
+ ? new KernelTypeGraphBuilder(element, resolvedAst, compiler, this)
+ : new ElementGraphBuilder(element, resolvedAst, compiler, this);
TypeInformation type;
reporter.withCurrentElement(element, () {
type = visitor.run();
« no previous file with comments | « pkg/compiler/lib/src/inferrer/builder_kernel.dart ('k') | pkg/compiler/lib/src/options.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698