File tree 1 file changed +11
-7
lines changed
test/hotspot/jtreg/runtime/logging
1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change 28
28
* @summary Verify that the Deoptimization statistics are printed to the VM/Compiler log file
29
29
* @library /test/lib
30
30
* @run main/othervm -Xbatch -XX:-UseOnStackReplacement -XX:-OmitStackTraceInFastThrow
31
- * -XX:-OmitStackTraceInFastThrow
32
31
* -XX:+UnlockDiagnosticVMOptions -XX:+LogCompilation
33
32
* -XX:-LogVMOutput -XX:LogFile=compilation.log DeoptStats
34
33
* @run main/othervm -Xbatch -XX:-UseOnStackReplacement -XX:-OmitStackTraceInFastThrow
35
- * -XX:-OmitStackTraceInFastThrow
36
34
* -XX:+UnlockDiagnosticVMOptions -XX:+LogCompilation
37
35
* -XX:+LogVMOutput -XX:LogFile=vmOutput.log DeoptStats
38
36
* @run main/othervm DeoptStats compilation.log vmOutput.log
@@ -45,10 +43,16 @@ public class DeoptStats {
45
43
46
44
static class Value {
47
45
int i ;
46
+
47
+ public Value (int i ) { this .i = i ; }
48
48
}
49
49
50
50
static int f (Value v ) {
51
- return v .i ;
51
+ try {
52
+ return v .i ;
53
+ } catch (NullPointerException npe ) {
54
+ return -1 ;
55
+ }
52
56
}
53
57
54
58
public static void verify (String [] logFiles ) throws Exception {
@@ -64,12 +68,12 @@ public static void main(String[] args) throws Exception {
64
68
if (args .length > 0 ) {
65
69
verify (args );
66
70
} else {
71
+ Value zero = new Value (0 );
67
72
for (int i = 0 ; i < 20_000 ; i ++) {
68
- try {
69
- f (null );
70
- }
71
- catch (NullPointerException npe ) { }
73
+ f (zero );
72
74
}
75
+ // trigger null_check
76
+ f (null );
73
77
}
74
78
}
75
79
}
You can’t perform that action at this time.
0 commit comments