# HG changeset patch # User Doug Simon # Date 1409001644 -7200 # Node ID 29aa6f015c1665407bc8ab9ccdb5b4e2958e3ebb # Parent 93e0611578116aa038e5ecb29d94d0ee142da477 used void timer/metric implementation for conditional timers/metrics if neither -G:Time nor -G:Meter is specified diff -r 93e061157811 -r 29aa6f015c16 graal/com.oracle.graal.debug/src/com/oracle/graal/debug/Debug.java --- a/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/Debug.java Mon Aug 25 20:59:56 2014 +0200 +++ b/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/Debug.java Mon Aug 25 23:20:44 2014 +0200 @@ -929,6 +929,9 @@ private static DebugMetric createMetric(String format, Object arg1, Object arg2) { String name = formatDebugName(format, arg1, arg2); boolean conditional = enabledMetrics == null || !enabledMetrics.contains(name); + if (!ENABLED && conditional) { + return VOID_METRIC; + } return new MetricImpl(name, conditional); } @@ -1203,6 +1206,9 @@ private static DebugTimer createTimer(String format, Object arg1, Object arg2) { String name = formatDebugName(format, arg1, arg2); boolean conditional = enabledTimers == null || !enabledTimers.contains(name); + if (!ENABLED && conditional) { + return VOID_TIMER; + } return new TimerImpl(name, conditional); }