Mercurial > hg > graal-compiler
annotate test/compiler/uncommontrap/TestLockEliminatedAtDeopt.java @ 20048:8af4e7e0ac9f
Make IGV more robust when parsing block information
author | Gilles Duboscq <gilles.m.duboscq@oracle.com> |
---|---|
date | Fri, 27 Mar 2015 14:09:21 +0100 |
parents | 3df21373e577 |
children |
rev | line source |
---|---|
14510
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
1 /* |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
2 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
4 * |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
8 * |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
13 * accompanied this code). |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
14 * |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
18 * |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
21 * questions. |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
22 */ |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
23 |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
24 /* |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
25 * @test |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
26 * @bug 8032011 |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
27 * @summary biased locking's revoke_bias locks monitor in compiled frame with eliminated lock |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
28 * @run main/othervm -XX:-UseOnStackReplacement -XX:CompileCommand=dontinline,TestLockEliminatedAtDeopt$A.m2 -XX:-BackgroundCompilation -XX:BiasedLockingStartupDelay=0 TestLockEliminatedAtDeopt |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
29 * |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
30 */ |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
31 |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
32 public class TestLockEliminatedAtDeopt { |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
33 |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
34 static class A { |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
35 void m() { |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
36 } |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
37 |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
38 // This lock is not eliminated but biased to main thread on |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
39 // first call |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
40 synchronized void m2(boolean trap) { |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
41 if (trap) { |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
42 new B(); |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
43 } |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
44 } |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
45 } |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
46 |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
47 static class B extends A { |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
48 void m() { |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
49 } |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
50 } |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
51 |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
52 static void m1(boolean trap) { |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
53 A a = new A(); |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
54 // This lock is eliminated by c2 |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
55 synchronized(a) { |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
56 a.m2(trap); |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
57 a.m(); |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
58 } |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
59 } |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
60 |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
61 public static void main(String[] args) { |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
62 for (int i = 0; i < 20000; i++) { |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
63 m1(false); |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
64 } |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
65 // Trigger uncommon trap in A.m2() (class unloaded) and |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
66 // deoptimization of m1() (CHA invalidated). Uncommon trap |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
67 // code locks monitor in m1's frame where's it's eliminated. |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
68 m1(true); |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
69 } |
3df21373e577
8032011: nsk/stress/jck60/jck60022 crashes in src\share\vm\runtime\synchronizer.cpp:239
roland
parents:
diff
changeset
|
70 } |