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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « codereview.settings ('k') | pkg/compiler/lib/src/compiler.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/common/tasks.dart
diff --git a/pkg/compiler/lib/src/common/tasks.dart b/pkg/compiler/lib/src/common/tasks.dart
index ff55724e2485730f145616438964cca858e5974e..e40f7d25c34291aef9c93cf85cfc72a73cfbc742 100644
--- a/pkg/compiler/lib/src/common/tasks.dart
+++ b/pkg/compiler/lib/src/common/tasks.dart
@@ -204,6 +204,22 @@ class CompilerTask {
return watch == null ? action() : measureSubtaskHelper(name, action);
}
+ /// Measure the time spent in [action] (if in verbose mode) and accumulate it
+ /// under a subtask with the given name.
+ measureSubtaskElement(String name, Element element, action()) {
+ return watch == null
+ ? reporter.withCurrentElement(element, action)
+ : measureSubtaskElementHelper(name, element, action);
+ }
+
+ /// Helper method for [measureSubtaskElement]. Don't call this directly as it
+ /// assumes that [watch] isn't null.
+ measureSubtaskElementHelper(String name, Element element, action()) {
+ assert(watch != null);
+ return reporter.withCurrentElement(
+ element, () => measureSubtaskHelper(name, action));
+ }
+
/// Helper method for [measureSubtask]. Don't call this directly as it
/// assumes that [watch] isn't null.
measureSubtaskHelper(String name, action()) {
« 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