author | michaelm |
Fri, 16 Feb 2018 10:34:17 +0000 | |
branch | http-client-branch |
changeset 56137 | dd867826d55b |
parent 47216 | 71c04702a3d5 |
child 48791 | 6e079ff6c83c |
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 |
/* |
40631
ed82623d7831
8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents:
36851
diff
changeset
|
2 |
* Copyright (c) 2014, 2016, 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. |
40631
ed82623d7831
8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents:
36851
diff
changeset
|
28 |
* @library /test/lib |
36851 | 29 |
* @modules java.base/jdk.internal.misc |
29678
dd2f3932c21e
8075586: Add @modules as needed to the open hotspot tests
ykantser
parents:
29317
diff
changeset
|
30 |
* java.management |
40631
ed82623d7831
8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents:
36851
diff
changeset
|
31 |
* @build sun.hotspot.WhiteBox |
28163
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 |
|
40631
ed82623d7831
8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents:
36851
diff
changeset
|
37 |
import jdk.test.lib.process.ProcessTools; |
ed82623d7831
8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents:
36851
diff
changeset
|
38 |
import jdk.test.lib.process.OutputAnalyzer; |
ed82623d7831
8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents:
36851
diff
changeset
|
39 |
import jdk.test.lib.Platform; |
28163
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 |
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
|
42 |
|
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
43 |
public class AssertSafepointCheckConsistency3 { |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
44 |
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
|
45 |
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
|
46 |
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
|
47 |
} |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
48 |
if (Platform.isDebugBuild()){ |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
49 |
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
|
50 |
"-Xbootclasspath/a:.", |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
51 |
"-XX:+UnlockDiagnosticVMOptions", |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
52 |
"-XX:+WhiteBoxAPI", |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
53 |
"-XX:-TransmitErrorReport", |
30240
a7ba42fa1df6
8074354: Make CreateMinidumpOnCrash a new name and available on all platforms
minqi
parents:
29678
diff
changeset
|
54 |
"-XX:-CreateCoredumpOnCrash", |
28163
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
55 |
"-Xmx32m", |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
56 |
"AssertSafepointCheckConsistency3", |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
57 |
"test"); |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
58 |
|
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
59 |
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
|
60 |
output.shouldNotContain("assert"); |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
61 |
output.shouldNotContain("never"); |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
62 |
output.shouldNotContain("always"); |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
63 |
} |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
64 |
} |
322d55d167be
8047290: Make Mutex::_no_safepoint_check_flag locks verify that this lock never checks for safepoint
coleenp
parents:
diff
changeset
|
65 |
} |