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

Unified Diff: pkg/compiler/lib/src/apiimpl.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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/closure.dart » ('j') | pkg/compiler/lib/src/common/tasks.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/apiimpl.dart
diff --git a/pkg/compiler/lib/src/apiimpl.dart b/pkg/compiler/lib/src/apiimpl.dart
index 631d29b3d22f1cdf7704182ec1c6153f681f0a81..6e925bbfec8d112044ce706312a50a91d1fab940 100644
--- a/pkg/compiler/lib/src/apiimpl.dart
+++ b/pkg/compiler/lib/src/apiimpl.dart
@@ -31,6 +31,7 @@ import 'serialization/system.dart';
/// Implements the [Compiler] using a [api.CompilerInput] for supplying the
/// sources.
class CompilerImpl extends Compiler {
+ final Measurer measurer;
api.CompilerInput provider;
api.CompilerDiagnostics handler;
Packages packages;
@@ -50,7 +51,10 @@ class CompilerImpl extends Compiler {
CompilerImpl(this.provider, api.CompilerOutput outputProvider, this.handler,
CompilerOptions options,
{MakeBackendFuncion makeBackend, MakeReporterFunction makeReporter})
- : resolvedUriTranslator = new ForwardingResolvedUriTranslator(),
+ // NOTE: allocating measurer is done upfront to ensure the wallclock is
+ // started before other computations.
+ : measurer = new Measurer(enableTaskMeasurements: options.verbose),
+ resolvedUriTranslator = new ForwardingResolvedUriTranslator(),
super(
options: options,
outputProvider: outputProvider,
@@ -60,9 +64,10 @@ class CompilerImpl extends Compiler {
_Environment env = environment;
env.compiler = this;
tasks.addAll([
- userHandlerTask = new GenericTask('Diagnostic handler', this),
- userProviderTask = new GenericTask('Input provider', this),
- userPackagesDiscoveryTask = new GenericTask('Package discovery', this),
+ userHandlerTask = new GenericTask('Diagnostic handler', measurer),
+ userProviderTask = new GenericTask('Input provider', measurer),
+ userPackagesDiscoveryTask =
+ new GenericTask('Package discovery', measurer),
]);
}
« no previous file with comments | « no previous file | pkg/compiler/lib/src/closure.dart » ('j') | pkg/compiler/lib/src/common/tasks.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698