Skip to content

Commit 09228d5

Browse files
committed
Make isEnabled helpers respect unscoped controls
1 parent d39ce2d commit 09228d5

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/debug/test/DebugContextTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ public void testIsCountEnabled1() {
344344
map.put(DebugOptions.Count, "");
345345
OptionValues options = new OptionValues(map);
346346
DebugContext debug = new Builder(options).build();
347-
try (Scope s1 = debug.scope("Scope")) {
347+
try (Scope _ = debug.scope("Scope")) {
348348
Assert.assertTrue(debug.isCountEnabled());
349349
}
350350
}
@@ -355,7 +355,7 @@ public void testIsCountEnabled2() {
355355
map.put(DebugOptions.Counters, "");
356356
OptionValues options = new OptionValues(map);
357357
DebugContext debug = new Builder(options).build();
358-
try (Scope s1 = debug.scope("Scope")) {
358+
try (Scope _ = debug.scope("Scope")) {
359359
Assert.assertTrue(debug.isCountEnabled());
360360
}
361361
}

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/debug/DebugContext.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -764,15 +764,15 @@ public boolean isVerifyEnabled() {
764764
}
765765

766766
public boolean isCountEnabled() {
767-
return currentScope != null && currentScope.isCountEnabled();
767+
return currentScope != null && currentScope.isCountEnabled() || immutable.unscopedCounters != null;
768768
}
769769

770770
public boolean isTimeEnabled() {
771-
return currentScope != null && currentScope.isTimeEnabled();
771+
return currentScope != null && currentScope.isTimeEnabled() || immutable.unscopedTimers != null;
772772
}
773773

774774
public boolean isMemUseTrackingEnabled() {
775-
return currentScope != null && currentScope.isMemUseTrackingEnabled();
775+
return currentScope != null && currentScope.isMemUseTrackingEnabled() || immutable.unscopedMemUseTrackers != null;
776776
}
777777

778778
public boolean isDumpEnabledForMethod() {

0 commit comments

Comments
 (0)