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

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

Issue 2488353004: Remove Compiler access from ResolutionEnqueuer (Closed)
Patch Set: Updated cf. comments. Created 4 years, 1 month 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/types/type_mask.dart ('k') | pkg/compiler/lib/src/types/union_type_mask.dart » ('j') | 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 ad890dc6c79f6aaaee44a7880f2eb00d1abbeba8..eac9b46233dd81959705e0cdfd0e4709499e17e9 100644
--- a/pkg/compiler/lib/src/types/types.dart
+++ b/pkg/compiler/lib/src/types/types.dart
@@ -128,23 +128,26 @@ class GlobalTypeInferenceTask extends CompilerTask {
final String name = 'Type inference';
final Compiler compiler;
- TypesInferrer typesInferrer;
- CommonMasks masks;
+
+ /// The [TypeInferrer] used by the global type inference. This should by
+ /// accessed from outside this class for testing only.
+ TypesInferrer typesInferrerInternal;
+
GlobalTypeInferenceResults results;
GlobalTypeInferenceTask(Compiler compiler)
- : masks = new CommonMasks(compiler),
- compiler = compiler,
- super(compiler.measurer) {
- typesInferrer = new TypeGraphInferrer(compiler, masks);
- }
+ : compiler = compiler,
+ super(compiler.measurer);
/// Runs the global type-inference algorithm once.
void runGlobalTypeInference(Element mainElement) {
measure(() {
- typesInferrer.analyzeMain(mainElement);
- typesInferrer.clear();
- results = new GlobalTypeInferenceResults(typesInferrer, compiler, masks);
+ CommonMasks masks = compiler.closedWorld.commonMasks;
+ typesInferrerInternal ??= new TypeGraphInferrer(compiler, masks);
+ typesInferrerInternal.analyzeMain(mainElement);
+ typesInferrerInternal.clear();
+ results = new GlobalTypeInferenceResults(
+ typesInferrerInternal, compiler, masks);
});
}
}
« no previous file with comments | « pkg/compiler/lib/src/types/type_mask.dart ('k') | pkg/compiler/lib/src/types/union_type_mask.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698