author | tschatzl |
Wed, 19 Aug 2015 13:47:40 +0200 | |
changeset 32377 | 5ee15c417d02 |
parent 30604 | b8d532cb6420 |
child 33730 | 30e064828045 |
permissions | -rw-r--r-- |
28163
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
1 |
/* |
29678
dd2f3932c21e
8075586: Add @modules as needed to the open hotspot tests
ykantser
parents:
29317
diff
changeset
|
2 |
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. |
28163
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
4 |
* |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
8 |
* |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
13 |
* accompanied this code). |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
14 |
* |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
18 |
* |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
21 |
* questions. |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
22 |
*/ |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
23 |
|
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
24 |
/* |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
25 |
* @test |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
26 |
* @bug 8047290 |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
27 |
* @summary Ensure that Monitor::lock_without_safepoint_check does not assert when it correctly acquires a lock which must never have safepoint checks. |
28204
344d97fad05b
8067985: merging hs-comp to hs blocked by some tests not updated in 8054892
kvn
parents:
28163
diff
changeset
|
28 |
* @library /testlibrary /../../test/lib |
29678
dd2f3932c21e
8075586: Add @modules as needed to the open hotspot tests
ykantser
parents:
29317
diff
changeset
|
29 |
* @modules java.base/sun.misc |
dd2f3932c21e
8075586: Add @modules as needed to the open hotspot tests
ykantser
parents:
29317
diff
changeset
|
30 |
* java.management |
28163
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
31 |
* @build AssertSafepointCheckConsistency3 |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
32 |
* @run main ClassFileInstaller sun.hotspot.WhiteBox |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
33 |
* sun.hotspot.WhiteBox$WhiteBoxPermission |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
34 |
* @run main AssertSafepointCheckConsistency3 |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
35 |
*/ |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
36 |
|
30604
b8d532cb6420
8067013: Rename the com.oracle.java.testlibary package
ykantser
parents:
30240
diff
changeset
|
37 |
import jdk.test.lib.*; |
28163
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
38 |
|
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
39 |
import sun.hotspot.WhiteBox; |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
40 |
|
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
41 |
public class AssertSafepointCheckConsistency3 { |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
42 |
public static void main(String args[]) throws Exception { |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
43 |
if (args.length > 0) { |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
44 |
WhiteBox.getWhiteBox().assertMatchingSafepointCalls(false, true); |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
45 |
} |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
46 |
if (Platform.isDebugBuild()){ |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
47 |
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
48 |
"-Xbootclasspath/a:.", |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
49 |
"-XX:+UnlockDiagnosticVMOptions", |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
50 |
"-XX:+WhiteBoxAPI", |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
51 |
"-XX:-TransmitErrorReport", |
30240
a7ba42fa1df6
8074354: Make CreateMinidumpOnCrash a new name and available on all platforms
minqi
parents:
29678
diff
changeset
|
52 |
"-XX:-CreateCoredumpOnCrash", |
28163
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
53 |
"-Xmx32m", |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
54 |
"AssertSafepointCheckConsistency3", |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
55 |
"test"); |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
56 |
|
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
57 |
OutputAnalyzer output = new OutputAnalyzer(pb.start()); |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
58 |
output.shouldNotContain("assert"); |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
59 |
output.shouldNotContain("never"); |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
60 |
output.shouldNotContain("always"); |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
61 |
} |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
62 |
} |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
63 |
} |