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

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

Issue 2000323006: Make CompilerTask independent of compiler. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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: pkg/compiler/lib/src/deferred_load.dart
diff --git a/pkg/compiler/lib/src/deferred_load.dart b/pkg/compiler/lib/src/deferred_load.dart
index c34c06e402419a5d155c048d2c1046d15598da72..2f6df997fc1fa23fe73a9b25383d5f33d2abb7ed 100644
--- a/pkg/compiler/lib/src/deferred_load.dart
+++ b/pkg/compiler/lib/src/deferred_load.dart
@@ -152,11 +152,15 @@ class DeferredLoadTask extends CompilerTask {
Set<Element> _mainElements = new Set<Element>();
- DeferredLoadTask(Compiler compiler) : super(compiler) {
+ final Compiler compiler;
+ DeferredLoadTask(Compiler compiler)
+ : compiler = compiler,
+ super(compiler.measurer) {
mainOutputUnit.imports.add(_fakeMainImport);
}
Backend get backend => compiler.backend;
+ DiagnosticReporter get reporter => compiler.reporter;
/// Returns the [OutputUnit] where [element] belongs.
OutputUnit outputUnitForElement(Element element) {
@@ -629,7 +633,7 @@ class DeferredLoadTask extends CompilerTask {
_constantsDeferredBy = new Map<_DeferredImport, Set<ConstantValue>>();
_importedDeferredBy[_fakeMainImport] = _mainElements;
- measureElement(mainLibrary, () {
+ reporter.withCurrentElement(mainLibrary, () => measure(() {
// Starting from main, traverse the program and find all dependencies.
_mapDependencies(element: compiler.mainFunction, import: _fakeMainImport);
@@ -710,7 +714,7 @@ class DeferredLoadTask extends CompilerTask {
// Generate a unique name for each OutputUnit.
_assignNamesToOutputUnits(allOutputUnits);
- });
+ }));
// Notify the impact strategy impacts are no longer needed for deferred
// load.
compiler.impactStrategy.onImpactUsed(IMPACT_USE);

Powered by Google App Engine
This is Rietveld 408576698