File tree Expand file tree Collapse file tree 2 files changed +26
-5
lines changed
jdk.graal.compiler/src/jdk/graal/compiler/debug
jdk.graal.compiler.test/src/jdk/graal/compiler/debug/test Expand file tree Collapse file tree 2 files changed +26
-5
lines changed Original file line number Diff line number Diff line change @@ -337,4 +337,27 @@ public void testDebugConfig() {
337
337
Assert .assertTrue (options2 .toString ().contains ("MethodFilter=test" ));
338
338
Assert .assertTrue (options2 .toString ().contains ("DumpOnError=true" ));
339
339
}
340
+
341
+ @ Test
342
+ public void testIsCountEnabled1 () {
343
+ EconomicMap <OptionKey <?>, Object > map = EconomicMap .create ();
344
+ map .put (DebugOptions .Count , "" );
345
+ OptionValues options = new OptionValues (map );
346
+ DebugContext debug = new Builder (options ).build ();
347
+ try (Scope s1 = debug .scope ("Scope" )) {
348
+ Assert .assertTrue (debug .isCountEnabled ());
349
+ }
350
+ }
351
+
352
+ @ Test
353
+ public void testIsCountEnabled2 () {
354
+ EconomicMap <OptionKey <?>, Object > map = EconomicMap .create ();
355
+ map .put (DebugOptions .Counters , "" );
356
+ OptionValues options = new OptionValues (map );
357
+ DebugContext debug = new Builder (options ).build ();
358
+ try (Scope s1 = debug .scope ("Scope" )) {
359
+ Assert .assertTrue (debug .isCountEnabled ());
360
+ }
361
+ }
362
+
340
363
}
Original file line number Diff line number Diff line change @@ -160,17 +160,15 @@ public PrintStream output() {
160
160
}
161
161
162
162
private boolean isEnabled (DebugContext .Scope scope , DebugFilter filter ) {
163
- return getLevel (scope , filter ) >= 0 ;
163
+ return getLevel (scope , filter ) >= 1 ;
164
164
}
165
165
166
166
private int getLevel (DebugContext .Scope scope , DebugFilter filter ) {
167
- int level ;
168
167
if (filter == null ) {
169
168
// null means the value has not been set
170
- level = -1 ;
171
- } else {
172
- level = filter .matchLevel (scope );
169
+ return -1 ;
173
170
}
171
+ int level = filter .matchLevel (scope );
174
172
if (level >= 0 && !checkMethodFilter (scope )) {
175
173
level = -1 ;
176
174
}
You can’t perform that action at this time.
0 commit comments