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

Unified Diff: pkg/compiler/lib/src/tracer.dart

Issue 2696513003: Add output_type_test (Closed)
Patch Set: Created 3 years, 10 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 | « pkg/compiler/lib/src/source_file_provider.dart ('k') | tests/compiler/dart2js/data/deferred_helper.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/tracer.dart
diff --git a/pkg/compiler/lib/src/tracer.dart b/pkg/compiler/lib/src/tracer.dart
index 02331433ad1fc9c3ab54f545c4da9a9392620191..0c5336a2b84fe117bddb8abcbc0eb2b1797f9d18 100644
--- a/pkg/compiler/lib/src/tracer.dart
+++ b/pkg/compiler/lib/src/tracer.dart
@@ -17,10 +17,12 @@ import 'world.dart' show ClosedWorld;
* If non-null, we only trace methods whose name match the regexp defined by the
* given pattern.
*/
-const String TRACE_FILTER_PATTERN = const String.fromEnvironment("DUMP_IR");
+String get TRACE_FILTER_PATTERN =>
+ TRACE_FILTER_PATTERN_FROM_ENVIRONMENT ?? TRACE_FILTER_PATTERN_FOR_TEST;
-final RegExp TRACE_FILTER =
- TRACE_FILTER_PATTERN == null ? null : new RegExp(TRACE_FILTER_PATTERN);
+const String TRACE_FILTER_PATTERN_FROM_ENVIRONMENT =
+ const String.fromEnvironment("DUMP_IR");
+String TRACE_FILTER_PATTERN_FOR_TEST;
/**
* Dumps the intermediate representation after each phase in a format
@@ -31,15 +33,21 @@ class Tracer extends TracerUtil {
final Namer namer;
bool traceActive = false;
final EventSink<String> output;
- final bool isEnabled = TRACE_FILTER != null;
+ final RegExp traceFilter;
Tracer(
this.closedWorld, this.namer, api.CompilerOutputProvider outputProvider)
- : output = TRACE_FILTER != null ? outputProvider('dart', 'cfg') : null;
+ : traceFilter = TRACE_FILTER_PATTERN == null
+ ? null
+ : new RegExp(TRACE_FILTER_PATTERN),
+ output =
+ TRACE_FILTER_PATTERN != null ? outputProvider('dart', 'cfg') : null;
+
+ bool get isEnabled => traceFilter != null;
void traceCompilation(String methodName) {
if (!isEnabled) return;
- traceActive = TRACE_FILTER.hasMatch(methodName);
+ traceActive = traceFilter.hasMatch(methodName);
if (!traceActive) return;
tag("compilation", () {
printProperty("name", methodName);
« no previous file with comments | « pkg/compiler/lib/src/source_file_provider.dart ('k') | tests/compiler/dart2js/data/deferred_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698