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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/compiler.dart

Issue 11421060: Improve measuring (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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 | « dart/sdk/lib/_internal/compiler/implementation/apiimpl.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/sdk/lib/_internal/compiler/implementation/compiler.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/compiler.dart b/dart/sdk/lib/_internal/compiler/implementation/compiler.dart
index e770cff2319056437c6eff12c693a9ed17a56240..7b8de7aa0e7d2f269f34cff9d24eeae7c46ca474 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/compiler.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/compiler.dart
@@ -58,6 +58,16 @@ class WorkItem {
}
}
+class UnreportedTask extends CompilerTask {
+ UnreportedTask(Compiler compiler) : super(compiler);
+ String get name => 'Unreported';
+}
+
+class ReadingFilesTask extends CompilerTask {
+ ReadingFilesTask(Compiler compiler) : super(compiler);
+ String get name => 'Reading input files';
+}
+
abstract class Backend {
final Compiler compiler;
final ConstantSystem constantSystem;
@@ -190,6 +200,8 @@ abstract class Compiler implements DiagnosticListener {
Backend backend;
ConstantHandler constantHandler;
EnqueueTask enqueuer;
+ CompilerTask unreported;
+ CompilerTask fileReadingTask;
static const SourceString MAIN = const SourceString('main');
static const SourceString CALL_OPERATOR_NAME = const SourceString('call');
@@ -232,27 +244,31 @@ abstract class Compiler implements DiagnosticListener {
progress = new Stopwatch() {
progress.start();
world = new World(this);
- scanner = new ScannerTask(this);
- dietParser = new DietParserTask(this);
- parser = new ParserTask(this);
- patchParser = new PatchParserTask(this);
- libraryLoader = new LibraryLoaderTask(this);
- validator = new TreeValidatorTask(this);
- resolver = new ResolverTask(this);
- closureToClassMapper = new closureMapping.ClosureTask(this);
- checker = new TypeCheckerTask(this);
- typesTask = new ti.TypesTask(this, enableConcreteTypeInference);
backend = emitJavaScript ?
new js_backend.JavaScriptBackend(this,
generateSourceMap,
disallowUnsafeEval) :
new dart_backend.DartBackend(this, strips);
- constantHandler = new ConstantHandler(this, backend.constantSystem);
- enqueuer = new EnqueueTask(this);
- tasks = [scanner, dietParser, parser, patchParser, libraryLoader,
- resolver, closureToClassMapper, checker, typesTask,
- constantHandler, enqueuer];
+
+ // No-op in production mode.
+ validator = new TreeValidatorTask(this);
+
+ tasks = [
+ fileReadingTask = new ReadingFilesTask(this),
+ libraryLoader = new LibraryLoaderTask(this),
+ scanner = new ScannerTask(this),
+ dietParser = new DietParserTask(this),
+ parser = new ParserTask(this),
+ patchParser = new PatchParserTask(this),
+ resolver = new ResolverTask(this),
+ closureToClassMapper = new closureMapping.ClosureTask(this),
+ checker = new TypeCheckerTask(this),
+ typesTask = new ti.TypesTask(this, enableConcreteTypeInference),
+ constantHandler = new ConstantHandler(this, backend.constantSystem),
+ enqueuer = new EnqueueTask(this)];
+
tasks.addAll(backend.tasks);
+ tasks.add(unreported = new UnreportedTask(this));
}
Universe get resolverWorld => enqueuer.resolution.universe;
@@ -341,7 +357,7 @@ abstract class Compiler implements DiagnosticListener {
bool run(Uri uri) {
try {
- runCompiler(uri);
+ unreported.measure(() => runCompiler(uri));
ngeoffray 2012/11/27 09:14:07 Will that just measure the non-measured time at th
ahe 2012/11/30 12:00:37 I have changed it. Now it looks like this: info:
} on CompilerCancelledException catch (exception) {
log('Error: $exception');
return false;
« no previous file with comments | « dart/sdk/lib/_internal/compiler/implementation/apiimpl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698