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

Side by Side Diff: pkg/compiler/lib/src/common/tasks.dart

Issue 1803303002: Move all flags to CompilerOptions (first step to stop passing the compiler to (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library dart2js.common.tasks; 5 library dart2js.common.tasks;
6 6
7 import 'dart:developer' show 7 import 'dart:developer' show
8 UserTag; 8 UserTag;
9 9
10 import '../common.dart'; 10 import '../common.dart';
(...skipping 12 matching lines...) Expand all
23 } 23 }
24 24
25 class CompilerTask { 25 class CompilerTask {
26 final Compiler compiler; 26 final Compiler compiler;
27 final Stopwatch watch; 27 final Stopwatch watch;
28 UserTag profilerTag; 28 UserTag profilerTag;
29 final Map<String, GenericTask> _subtasks = <String, GenericTask>{}; 29 final Map<String, GenericTask> _subtasks = <String, GenericTask>{};
30 30
31 CompilerTask(Compiler compiler) 31 CompilerTask(Compiler compiler)
32 : this.compiler = compiler, 32 : this.compiler = compiler,
33 watch = (compiler.verbose) ? new Stopwatch() : null; 33 watch = (compiler.options.verbose) ? new Stopwatch() : null;
34 34
35 DiagnosticReporter get reporter => compiler.reporter; 35 DiagnosticReporter get reporter => compiler.reporter;
36 36
37 String get name => "Unknown task '${this.runtimeType}'"; 37 String get name => "Unknown task '${this.runtimeType}'";
38 38
39 int get timing { 39 int get timing {
40 if (watch == null) return 0; 40 if (watch == null) return 0;
41 int total = watch.elapsedMilliseconds; 41 int total = watch.elapsedMilliseconds;
42 for (GenericTask subtask in _subtasks.values) { 42 for (GenericTask subtask in _subtasks.values) {
43 total += subtask.timing; 43 total += subtask.timing;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 89
90 int getSubtaskTime(String subtask) => _subtasks[subtask].timing; 90 int getSubtaskTime(String subtask) => _subtasks[subtask].timing;
91 } 91 }
92 92
93 class GenericTask extends CompilerTask { 93 class GenericTask extends CompilerTask {
94 final String name; 94 final String name;
95 95
96 GenericTask(this.name, Compiler compiler) 96 GenericTask(this.name, Compiler compiler)
97 : super(compiler); 97 : super(compiler);
98 } 98 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/commandline_options.dart ('k') | pkg/compiler/lib/src/compile_time_constants.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698