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

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

Issue 1971193002: Patches to support Dart VM patch files in dart2js. (Closed) Base URL: sso://user/ahe/dart-sdk@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « codereview.settings ('k') | pkg/compiler/lib/src/compiler.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:async' show 7 import 'dart:async' show
8 Future, 8 Future,
9 Zone, 9 Zone,
10 ZoneDelegate, 10 ZoneDelegate,
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 assert(watch != null); 197 assert(watch != null);
198 return reporter.withCurrentElement(element, () => measure(action)); 198 return reporter.withCurrentElement(element, () => measure(action));
199 } 199 }
200 200
201 /// Measure the time spent in [action] (if in verbose mode) and accumulate it 201 /// Measure the time spent in [action] (if in verbose mode) and accumulate it
202 /// under a subtask with the given name. 202 /// under a subtask with the given name.
203 measureSubtask(String name, action()) { 203 measureSubtask(String name, action()) {
204 return watch == null ? action() : measureSubtaskHelper(name, action); 204 return watch == null ? action() : measureSubtaskHelper(name, action);
205 } 205 }
206 206
207 /// Measure the time spent in [action] (if in verbose mode) and accumulate it
208 /// under a subtask with the given name.
209 measureSubtaskElement(String name, Element element, action()) {
210 return watch == null
211 ? reporter.withCurrentElement(element, action)
212 : measureSubtaskElementHelper(name, element, action);
213 }
214
215 /// Helper method for [measureSubtaskElement]. Don't call this directly as it
216 /// assumes that [watch] isn't null.
217 measureSubtaskElementHelper(String name, Element element, action()) {
218 assert(watch != null);
219 return reporter.withCurrentElement(
220 element, () => measureSubtaskHelper(name, action));
221 }
222
207 /// Helper method for [measureSubtask]. Don't call this directly as it 223 /// Helper method for [measureSubtask]. Don't call this directly as it
208 /// assumes that [watch] isn't null. 224 /// assumes that [watch] isn't null.
209 measureSubtaskHelper(String name, action()) { 225 measureSubtaskHelper(String name, action()) {
210 assert(watch != null); 226 assert(watch != null);
211 // Use a nested CompilerTask for the measurement to ensure nested [measure] 227 // Use a nested CompilerTask for the measurement to ensure nested [measure]
212 // calls work correctly. The subtasks will never themselves have nested 228 // calls work correctly. The subtasks will never themselves have nested
213 // subtasks because they are not accessible outside. 229 // subtasks because they are not accessible outside.
214 GenericTask subtask = 230 GenericTask subtask =
215 _subtasks.putIfAbsent(name, () => new GenericTask(name, compiler)); 231 _subtasks.putIfAbsent(name, () => new GenericTask(name, compiler));
216 return subtask.measure(action); 232 return subtask.measure(action);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 } 282 }
267 283
268 /// Call this when the eventloop returns control to us. 284 /// Call this when the eventloop returns control to us.
269 void stopAsyncWallClock() { 285 void stopAsyncWallClock() {
270 if (currentAsyncTask != null) { 286 if (currentAsyncTask != null) {
271 currentAsyncTask.watch.stop(); 287 currentAsyncTask.watch.stop();
272 } 288 }
273 asyncWallClock.stop(); 289 asyncWallClock.stop();
274 } 290 }
275 } 291 }
OLDNEW
« no previous file with comments | « codereview.settings ('k') | pkg/compiler/lib/src/compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698