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

Unified Diff: pkg/compiler/lib/src/js_backend/backend.dart

Issue 1288593002: dart2js: add function coverage tracking in dart2js output, dumpinfo, and (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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
Index: pkg/compiler/lib/src/js_backend/backend.dart
diff --git a/pkg/compiler/lib/src/js_backend/backend.dart b/pkg/compiler/lib/src/js_backend/backend.dart
index bdd1cc3a191627127c1f758e0476e1f6ecff0083..50e2068cdf96914a89f9c4ead41e2433b638d7bc 100644
--- a/pkg/compiler/lib/src/js_backend/backend.dart
+++ b/pkg/compiler/lib/src/js_backend/backend.dart
@@ -333,10 +333,13 @@ class JavaScriptBackend extends Backend {
ClassElement jsInvocationMirrorClass;
- /// If [true], the compiler will emit code that writes the name of the current
- /// method together with its class and library to the console the first time
- /// the method is called.
- static const bool TRACE_CALLS = false;
+ /// If [true], the compiler will emit code that logs whenever a method is
+ /// called. When TRACE_METHOD is 'console' this will be logged
+ /// directly in the JavaScript console. When TRACE_METHOD is 'post' the
+ /// information will be sent to a server via a POST request.
+ static const String TRACE_METHOD = const String.fromEnvironment('traceCalls');
+ static const bool TRACE_CALLS =
+ TRACE_METHOD == 'post' || TRACE_METHOD == 'console';
Element traceHelper;
TypeMask get stringType => compiler.typesTask.stringType;
@@ -1160,7 +1163,8 @@ class JavaScriptBackend extends Backend {
}
if (TRACE_CALLS) {
- traceHelper = findHelper('traceHelper');
+ traceHelper = findHelper(
+ TRACE_METHOD == 'console' ? 'consoleTraceHelper' : 'postTraceHelper');
assert(traceHelper != null);
enqueueInResolution(traceHelper, registry);
}

Powered by Google App Engine
This is Rietveld 408576698