< prev index next >

test/hotspot/jtreg/compiler/escapeAnalysis/Test8329757.java

Print this page

26  * @bug 8329757
27  * @summary Deoptimization with nested eliminated and not eliminated locks
28  *          caused reordered lock stacks. This can be handled by the interpreter
29  *          but when a frame is migrated back to compiled code via OSR the C2
30  *          assumption about balanced monitorenter-monitorexit is broken.
31  *
32  * @requires vm.compMode != "Xint"
33  *
34  * @run main/othervm compiler.escapeAnalysis.Test8329757
35  */
36 
37 package compiler.escapeAnalysis;
38 
39 public class Test8329757 {
40 
41     int a = 400;
42     Double ddd;
43 
44     void q() {
45         int e;
46         synchronized (new Double(1.1f)) {
47         int[] f = new int[a];
48         synchronized (Test8329757.class) {
49             for (int d = 4; d < 127; d++) {
50             e = 13;
51             do switch (d * 5) {
52                 case 0:
53                 case 42:
54                 case 29:
55                 e = d;
56                 default:
57                 f[1] = e;
58             } while (--e > 0);
59             }
60         }
61         }
62     }
63 
64     void n() {
65         for (int j = 6; j < 274; ++j) q();
66     }

26  * @bug 8329757
27  * @summary Deoptimization with nested eliminated and not eliminated locks
28  *          caused reordered lock stacks. This can be handled by the interpreter
29  *          but when a frame is migrated back to compiled code via OSR the C2
30  *          assumption about balanced monitorenter-monitorexit is broken.
31  *
32  * @requires vm.compMode != "Xint"
33  *
34  * @run main/othervm compiler.escapeAnalysis.Test8329757
35  */
36 
37 package compiler.escapeAnalysis;
38 
39 public class Test8329757 {
40 
41     int a = 400;
42     Double ddd;
43 
44     void q() {
45         int e;
46         synchronized (new Object()) {
47         int[] f = new int[a];
48         synchronized (Test8329757.class) {
49             for (int d = 4; d < 127; d++) {
50             e = 13;
51             do switch (d * 5) {
52                 case 0:
53                 case 42:
54                 case 29:
55                 e = d;
56                 default:
57                 f[1] = e;
58             } while (--e > 0);
59             }
60         }
61         }
62     }
63 
64     void n() {
65         for (int j = 6; j < 274; ++j) q();
66     }
< prev index next >