Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/hotspot/jtreg/compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java
41152 views
1
/*
2
* Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
*
5
* This code is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License version 2 only, as
7
* published by the Free Software Foundation.
8
*
9
* This code is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12
* version 2 for more details (a copy is included in the LICENSE file that
13
* accompanied this code).
14
*
15
* You should have received a copy of the GNU General Public License version
16
* 2 along with this work; if not, write to the Free Software Foundation,
17
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18
*
19
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20
* or visit www.oracle.com if you need additional information or have any
21
* questions.
22
*/
23
24
/**
25
* @test
26
* @bug 8031320
27
* @summary Verify UseRTMDeopt option processing on CPUs with rtm support
28
* when rtm locking is supported by VM.
29
* @library /test/lib /
30
* @modules java.base/jdk.internal.misc
31
* java.management
32
* @requires vm.flagless
33
* @requires vm.rtm.cpu & vm.rtm.compiler
34
* @run driver compiler.rtm.cli.TestUseRTMDeoptOptionOnSupportedConfig
35
*/
36
37
package compiler.rtm.cli;
38
39
import jdk.test.lib.process.ExitCode;
40
import jdk.test.lib.cli.CommandLineOptionTest;
41
42
public class TestUseRTMDeoptOptionOnSupportedConfig {
43
private static final String DEFAULT_VALUE = "false";
44
45
public void runTestCases() throws Throwable {
46
String shouldPassMessage = " JVM should startup with option '"
47
+ "-XX:+UseRTMDeopt' without any warnings";
48
// verify that option could be turned on
49
CommandLineOptionTest.verifySameJVMStartup(
50
null, null, shouldPassMessage, shouldPassMessage, ExitCode.OK,
51
"-XX:+UseRTMDeopt");
52
shouldPassMessage = " JVM should startup with option '"
53
+ "-XX:-UseRTMDeopt' without any warnings";
54
// verify that option could be turned off
55
CommandLineOptionTest.verifySameJVMStartup(
56
null, null, shouldPassMessage, shouldPassMessage, ExitCode.OK,
57
"-XX:-UseRTMDeopt");
58
String defValMessage = String.format("UseRTMDeopt should have '%s'"
59
+ "default value",
60
TestUseRTMDeoptOptionOnSupportedConfig.DEFAULT_VALUE);
61
// verify default value
62
CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMDeopt",
63
TestUseRTMDeoptOptionOnSupportedConfig.DEFAULT_VALUE,
64
defValMessage);
65
// verify default value
66
CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMDeopt",
67
TestUseRTMDeoptOptionOnSupportedConfig.DEFAULT_VALUE,
68
defValMessage,
69
CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
70
"-XX:+UseRTMLocking");
71
// verify that option is off when UseRTMLocking is off
72
CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMDeopt",
73
"false", "UseRTMDeopt should be off when UseRTMLocking is off",
74
CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
75
"-XX:-UseRTMLocking", "-XX:+UseRTMDeopt");
76
// verify that option could be turned on
77
CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMDeopt", "true",
78
"UseRTMDeopt should be on when UseRTMLocking is on and "
79
+ "'-XX:+UseRTMDeopt' flag set",
80
CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
81
"-XX:+UseRTMLocking", "-XX:+UseRTMDeopt");
82
}
83
84
public static void main(String args[]) throws Throwable {
85
new TestUseRTMDeoptOptionOnSupportedConfig().runTestCases();
86
}
87
}
88
89