8181124: Get rid of compiler.testlibrary.rtm.predicate

Reviewed-by: kvn
This commit is contained in:
Ekaterina Pavlova 2017-06-01 17:34:01 -07:00
parent 6b5aaf68c6
commit aee7d17ae2
45 changed files with 117 additions and 493 deletions

View file

@ -35,7 +35,7 @@ groups=TEST.groups [closed/TEST.groups]
# to determine additional characteristics of the system for use with the @requires tag. # to determine additional characteristics of the system for use with the @requires tag.
# Note: compiled bootlibs code will be located in the folder 'bootClasses' # Note: compiled bootlibs code will be located in the folder 'bootClasses'
requires.extraPropDefns = ../../test/jtreg-ext/requires/VMProps.java [../../closed/test/jtreg-ext/requires/VMPropsExt.java] requires.extraPropDefns = ../../test/jtreg-ext/requires/VMProps.java [../../closed/test/jtreg-ext/requires/VMPropsExt.java]
requires.extraPropDefns.bootlibs = ../../test/lib/sun requires.extraPropDefns.bootlibs = ../../test/lib/sun ../../test/lib/jdk/test/lib/Platform.java
requires.extraPropDefns.vmOpts = -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:bootClasses requires.extraPropDefns.vmOpts = -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:bootClasses
requires.properties= \ requires.properties= \
sun.arch.data.model \ sun.arch.data.model \
@ -48,7 +48,9 @@ requires.properties= \
vm.jvmci \ vm.jvmci \
vm.emulatedClient \ vm.emulatedClient \
vm.cpu.features \ vm.cpu.features \
vm.debug vm.debug \
vm.rtm.cpu \
vm.rtm.os
# Tests using jtreg 4.2 b07 features # Tests using jtreg 4.2 b07 features
requiredVersion=4.2 b07 requiredVersion=4.2 b07

View file

@ -32,8 +32,8 @@ import java.util.function.BooleanSupplier;
/** /**
* Base for all RTM-related CLI tests. * Base for all RTM-related CLI tests.
*/ */
public abstract class RTMGenericCommandLineOptionTest public abstract class RTMGenericCommandLineOptionTest {
extends CommandLineOptionTest {
protected static final String RTM_INSTR_ERROR protected static final String RTM_INSTR_ERROR
= "RTM instructions are not available on this CPU"; = "RTM instructions are not available on this CPU";
protected static final String RTM_UNSUPPORTED_VM_ERROR protected static final String RTM_UNSUPPORTED_VM_ERROR
@ -66,17 +66,15 @@ public abstract class RTMGenericCommandLineOptionTest
* Test constructed using this ctor will be started on any cpu regardless * Test constructed using this ctor will be started on any cpu regardless
* it's architecture and supported/unsupported features. * it's architecture and supported/unsupported features.
* *
* @param predicate predicate responsible for test's preconditions check
* @param optionName name of option to be tested * @param optionName name of option to be tested
* @param isBoolean {@code true} if option is binary * @param isBoolean {@code true} if option is binary
* @param isExperimental {@code true} if option is experimental * @param isExperimental {@code true} if option is experimental
* @param defaultValue default value of tested option * @param defaultValue default value of tested option
* @param optionValues different option values * @param optionValues different option values
*/ */
public RTMGenericCommandLineOptionTest(BooleanSupplier predicate, public RTMGenericCommandLineOptionTest(
String optionName, boolean isBoolean, boolean isExperimental, String optionName, boolean isBoolean, boolean isExperimental,
String defaultValue, String... optionValues) { String defaultValue, String... optionValues) {
super(predicate);
this.optionName = optionName; this.optionName = optionName;
this.isExperimental = isExperimental; this.isExperimental = isExperimental;
this.isBoolean = isBoolean; this.isBoolean = isBoolean;
@ -88,7 +86,6 @@ public abstract class RTMGenericCommandLineOptionTest
getExperimentalOptionErrorMessage(optionName); getExperimentalOptionErrorMessage(optionName);
} }
@Override
public void runTestCases() throws Throwable { public void runTestCases() throws Throwable {
if (Platform.isX86() || Platform.isX64() || Platform.isPPC()) { if (Platform.isX86() || Platform.isX64() || Platform.isPPC()) {
if (Platform.isServer()) { if (Platform.isServer()) {

View file

@ -23,12 +23,8 @@
package compiler.rtm.cli; package compiler.rtm.cli;
import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.test.lib.process.ExitCode; import jdk.test.lib.process.ExitCode;
import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.CommandLineOptionTest;
import jdk.test.lib.cli.predicate.AndPredicate;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
@ -66,8 +62,7 @@ public abstract class RTMLockingAwareTest
boolean isExperimental, String defaultValue, boolean isExperimental, String defaultValue,
String[] correctValues, String[] incorrectValues, String[] correctValues, String[] incorrectValues,
String warningMessage) { String warningMessage) {
super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM()), super(optionName, isBoolean, isExperimental, defaultValue);
optionName, isBoolean, isExperimental, defaultValue);
this.correctValues = correctValues; this.correctValues = correctValues;
this.incorrectValues = incorrectValues; this.incorrectValues = incorrectValues;
this.warningMessage = warningMessage; this.warningMessage = warningMessage;

View file

@ -27,15 +27,12 @@ import jdk.test.lib.process.ExitCode;
import jdk.test.lib.Platform; import jdk.test.lib.Platform;
import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.CommandLineOptionTest;
import java.util.function.BooleanSupplier;
public abstract class TestPrintPreciseRTMLockingStatisticsBase public abstract class TestPrintPreciseRTMLockingStatisticsBase
extends RTMGenericCommandLineOptionTest { extends RTMGenericCommandLineOptionTest {
protected static final String DEFAULT_VALUE = "false"; protected static final String DEFAULT_VALUE = "false";
protected TestPrintPreciseRTMLockingStatisticsBase( protected TestPrintPreciseRTMLockingStatisticsBase() {
BooleanSupplier predicate) { super("PrintPreciseRTMLockingStatistics", true, false,
super(predicate, "PrintPreciseRTMLockingStatistics", true, false,
TestPrintPreciseRTMLockingStatisticsBase.DEFAULT_VALUE); TestPrintPreciseRTMLockingStatisticsBase.DEFAULT_VALUE);
} }

View file

@ -29,7 +29,7 @@
* @library /test/lib / * @library /test/lib /
* @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.misc
* java.management * java.management
* * @requires vm.flavor == "server" & !vm.emulatedClient & vm.rtm.cpu & vm.rtm.os
* @build sun.hotspot.WhiteBox * @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission * sun.hotspot.WhiteBox$WhiteBoxPermission
@ -40,17 +40,10 @@
package compiler.rtm.cli; package compiler.rtm.cli;
import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.CommandLineOptionTest;
import jdk.test.lib.cli.predicate.AndPredicate;
public class TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig public class TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig
extends TestPrintPreciseRTMLockingStatisticsBase { extends TestPrintPreciseRTMLockingStatisticsBase {
private TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig() {
super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM()));
}
@Override @Override
protected void verifyOptionValues() throws Throwable { protected void verifyOptionValues() throws Throwable {
@ -87,6 +80,6 @@ public class TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig
public static void main(String args[]) throws Throwable { public static void main(String args[]) throws Throwable {
new TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig() new TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig()
.test(); .runTestCases();
} }
} }

View file

@ -29,7 +29,8 @@
* @library /test/lib / * @library /test/lib /
* @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.misc
* java.management * java.management
* * @requires !(vm.flavor == "server" & !vm.emulatedClient & vm.rtm.cpu & vm.rtm.os)
* @build sun.hotspot.WhiteBox
* @build compiler.rtm.cli.TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig * @build compiler.rtm.cli.TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig
* @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission * sun.hotspot.WhiteBox$WhiteBoxPermission
@ -40,21 +41,11 @@
package compiler.rtm.cli; package compiler.rtm.cli;
import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.test.lib.cli.predicate.AndPredicate;
import jdk.test.lib.cli.predicate.NotPredicate;
public class TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig public class TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig
extends TestPrintPreciseRTMLockingStatisticsBase { extends TestPrintPreciseRTMLockingStatisticsBase {
private TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig() {
super(new NotPredicate(
new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM())));
}
public static void main(String args[]) throws Throwable { public static void main(String args[]) throws Throwable {
new TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig() new TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig()
.test(); .runTestCases();
} }
} }

View file

@ -29,7 +29,7 @@
* @library /test/lib / * @library /test/lib /
* @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.misc
* java.management * java.management
* * @requires vm.flavor == "server" & !vm.emulatedClient & vm.rtm.cpu & vm.rtm.os
* @build sun.hotspot.WhiteBox * @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission * sun.hotspot.WhiteBox$WhiteBoxPermission
@ -55,6 +55,6 @@ public class TestRTMAbortRatioOptionOnSupportedConfig
} }
public static void main(String args[]) throws Throwable { public static void main(String args[]) throws Throwable {
new TestRTMAbortRatioOptionOnSupportedConfig().test(); new TestRTMAbortRatioOptionOnSupportedConfig().runTestCases();
} }
} }

View file

@ -29,7 +29,7 @@
* @library /test/lib / * @library /test/lib /
* @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.misc
* java.management * java.management
* * @requires !(vm.flavor == "server" & !vm.emulatedClient & vm.rtm.cpu & vm.rtm.os)
* @build sun.hotspot.WhiteBox * @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission * sun.hotspot.WhiteBox$WhiteBoxPermission
@ -40,25 +40,17 @@
package compiler.rtm.cli; package compiler.rtm.cli;
import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.test.lib.cli.predicate.AndPredicate;
import jdk.test.lib.cli.predicate.NotPredicate;
public class TestRTMAbortRatioOptionOnUnsupportedConfig public class TestRTMAbortRatioOptionOnUnsupportedConfig
extends RTMGenericCommandLineOptionTest { extends RTMGenericCommandLineOptionTest {
private static final String DEFAULT_VALUE = "50"; private static final String DEFAULT_VALUE = "50";
private TestRTMAbortRatioOptionOnUnsupportedConfig() { private TestRTMAbortRatioOptionOnUnsupportedConfig() {
super(new NotPredicate( super("RTMAbortRatio", false, true,
new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM())),
"RTMAbortRatio", false, true,
TestRTMAbortRatioOptionOnUnsupportedConfig.DEFAULT_VALUE, TestRTMAbortRatioOptionOnUnsupportedConfig.DEFAULT_VALUE,
"0", "10", "100", "200"); "0", "10", "100");
} }
public static void main(String args[]) throws Throwable { public static void main(String args[]) throws Throwable {
new TestRTMAbortRatioOptionOnUnsupportedConfig().test(); new TestRTMAbortRatioOptionOnUnsupportedConfig().runTestCases();
} }
} }

View file

@ -39,12 +39,12 @@ public class TestRTMAbortThresholdOption
private static final String DEFAULT_VALUE = "1000"; private static final String DEFAULT_VALUE = "1000";
private TestRTMAbortThresholdOption() { private TestRTMAbortThresholdOption() {
super(Boolean.TRUE::booleanValue, "RTMAbortThreshold", false, true, super("RTMAbortThreshold", false, true,
TestRTMAbortThresholdOption.DEFAULT_VALUE, TestRTMAbortThresholdOption.DEFAULT_VALUE,
"0", "42", "100", "10000"); "0", "42", "100", "10000");
} }
public static void main(String args[]) throws Throwable { public static void main(String args[]) throws Throwable {
new TestRTMAbortThresholdOption().test(); new TestRTMAbortThresholdOption().runTestCases();
} }
} }

View file

@ -39,11 +39,11 @@ public class TestRTMLockingCalculationDelayOption
private static final String DEFAULT_VALUE = "0"; private static final String DEFAULT_VALUE = "0";
private TestRTMLockingCalculationDelayOption() { private TestRTMLockingCalculationDelayOption() {
super(Boolean.TRUE::booleanValue, "RTMLockingCalculationDelay", false, super("RTMLockingCalculationDelay", false,
true, TestRTMLockingCalculationDelayOption.DEFAULT_VALUE); true, TestRTMLockingCalculationDelayOption.DEFAULT_VALUE);
} }
public static void main(String agrs[]) throws Throwable { public static void main(String agrs[]) throws Throwable {
new TestRTMLockingCalculationDelayOption().test(); new TestRTMLockingCalculationDelayOption().runTestCases();
} }
} }

View file

@ -39,11 +39,11 @@ public class TestRTMLockingThresholdOption
private static final String DEFAULT_VALUE = "10000"; private static final String DEFAULT_VALUE = "10000";
private TestRTMLockingThresholdOption() { private TestRTMLockingThresholdOption() {
super(Boolean.TRUE::booleanValue, "RTMLockingThreshold", false, true, super("RTMLockingThreshold", false, true,
TestRTMLockingThresholdOption.DEFAULT_VALUE); TestRTMLockingThresholdOption.DEFAULT_VALUE);
} }
public static void main(String args[]) throws Throwable { public static void main(String args[]) throws Throwable {
new TestRTMLockingThresholdOption().test(); new TestRTMLockingThresholdOption().runTestCases();
} }
} }

View file

@ -38,12 +38,12 @@ public class TestRTMRetryCountOption extends RTMGenericCommandLineOptionTest {
private static final String DEFAULT_VALUE = "5"; private static final String DEFAULT_VALUE = "5";
private TestRTMRetryCountOption() { private TestRTMRetryCountOption() {
super(Boolean.TRUE::booleanValue, "RTMRetryCount", false, false, super("RTMRetryCount", false, false,
TestRTMRetryCountOption.DEFAULT_VALUE, TestRTMRetryCountOption.DEFAULT_VALUE,
"0", "10", "100", "1000"); "0", "10", "100", "1000");
} }
public static void main(String args[]) throws Throwable { public static void main(String args[]) throws Throwable {
new TestRTMRetryCountOption().test(); new TestRTMRetryCountOption().runTestCases();
} }
} }

View file

@ -39,12 +39,12 @@ public class TestRTMSpinLoopCountOption
private static final String DEFAULT_VALUE = "100"; private static final String DEFAULT_VALUE = "100";
private TestRTMSpinLoopCountOption() { private TestRTMSpinLoopCountOption() {
super(Boolean.TRUE::booleanValue, "RTMSpinLoopCount", false, true, super("RTMSpinLoopCount", false, true,
TestRTMSpinLoopCountOption.DEFAULT_VALUE, TestRTMSpinLoopCountOption.DEFAULT_VALUE,
"0", "10", "42", "1000"); "0", "10", "42", "1000");
} }
public static void main(String args[]) throws Throwable { public static void main(String args[]) throws Throwable {
new TestRTMSpinLoopCountOption().test(); new TestRTMSpinLoopCountOption().runTestCases();
} }
} }

View file

@ -29,7 +29,7 @@
* @library /test/lib / * @library /test/lib /
* @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.misc
* java.management * java.management
* * @requires vm.flavor == "server" & !vm.emulatedClient & vm.rtm.cpu & vm.rtm.os
* @build sun.hotspot.WhiteBox * @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission * sun.hotspot.WhiteBox$WhiteBoxPermission
@ -55,6 +55,6 @@ public class TestRTMTotalCountIncrRateOptionOnSupportedConfig
} }
public static void main(String args[]) throws Throwable { public static void main(String args[]) throws Throwable {
new TestRTMTotalCountIncrRateOptionOnSupportedConfig().test(); new TestRTMTotalCountIncrRateOptionOnSupportedConfig().runTestCases();
} }
} }

View file

@ -29,7 +29,7 @@
* @library /test/lib / * @library /test/lib /
* @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.misc
* java.management * java.management
* * @requires !(vm.flavor == "server" & !vm.emulatedClient & vm.rtm.cpu & vm.rtm.os)
* @build sun.hotspot.WhiteBox * @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission * sun.hotspot.WhiteBox$WhiteBoxPermission
@ -40,26 +40,18 @@
package compiler.rtm.cli; package compiler.rtm.cli;
import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.test.lib.cli.predicate.AndPredicate;
import jdk.test.lib.cli.predicate.NotPredicate;
public class TestRTMTotalCountIncrRateOptionOnUnsupportedConfig public class TestRTMTotalCountIncrRateOptionOnUnsupportedConfig
extends RTMGenericCommandLineOptionTest { extends RTMGenericCommandLineOptionTest {
private static final String DEFAULT_VALUE = "64"; private static final String DEFAULT_VALUE = "64";
private TestRTMTotalCountIncrRateOptionOnUnsupportedConfig() { private TestRTMTotalCountIncrRateOptionOnUnsupportedConfig() {
super(new NotPredicate( super("RTMTotalCountIncrRate", false, true,
new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM())),
"RTMTotalCountIncrRate", false, true,
TestRTMTotalCountIncrRateOptionOnUnsupportedConfig TestRTMTotalCountIncrRateOptionOnUnsupportedConfig
.DEFAULT_VALUE, .DEFAULT_VALUE,
"-1", "0", "42", "128"); "1", "42", "128");
} }
public static void main(String args[]) throws Throwable { public static void main(String args[]) throws Throwable {
new TestRTMTotalCountIncrRateOptionOnUnsupportedConfig().test(); new TestRTMTotalCountIncrRateOptionOnUnsupportedConfig().runTestCases();
} }
} }

View file

@ -29,7 +29,7 @@
* @library /test/lib / * @library /test/lib /
* @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.misc
* java.management * java.management
* * @requires vm.flavor == "server" & !vm.emulatedClient & vm.rtm.cpu & vm.rtm.os
* @build sun.hotspot.WhiteBox * @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission * sun.hotspot.WhiteBox$WhiteBoxPermission
@ -40,22 +40,12 @@
package compiler.rtm.cli; package compiler.rtm.cli;
import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.test.lib.process.ExitCode; import jdk.test.lib.process.ExitCode;
import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.CommandLineOptionTest;
import jdk.test.lib.cli.predicate.AndPredicate;
public class TestUseRTMDeoptOptionOnSupportedConfig public class TestUseRTMDeoptOptionOnSupportedConfig {
extends CommandLineOptionTest {
private static final String DEFAULT_VALUE = "false"; private static final String DEFAULT_VALUE = "false";
private TestUseRTMDeoptOptionOnSupportedConfig() {
super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM()));
}
@Override
public void runTestCases() throws Throwable { public void runTestCases() throws Throwable {
String shouldPassMessage = " JVM should startup with option '" String shouldPassMessage = " JVM should startup with option '"
+ "-XX:+UseRTMDeopt' without any warnings"; + "-XX:+UseRTMDeopt' without any warnings";
@ -96,6 +86,6 @@ public class TestUseRTMDeoptOptionOnSupportedConfig
} }
public static void main(String args[]) throws Throwable { public static void main(String args[]) throws Throwable {
new TestUseRTMDeoptOptionOnSupportedConfig().test(); new TestUseRTMDeoptOptionOnSupportedConfig().runTestCases();
} }
} }

View file

@ -29,7 +29,7 @@
* @library /test/lib / * @library /test/lib /
* @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.misc
* java.management * java.management
* * @requires !(vm.flavor == "server" & !vm.emulatedClient & vm.rtm.cpu & vm.rtm.os)
* @build sun.hotspot.WhiteBox * @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission * sun.hotspot.WhiteBox$WhiteBoxPermission
@ -40,21 +40,14 @@
package compiler.rtm.cli; package compiler.rtm.cli;
import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.CommandLineOptionTest;
import jdk.test.lib.cli.predicate.AndPredicate;
import jdk.test.lib.cli.predicate.NotPredicate;
public class TestUseRTMDeoptOptionOnUnsupportedConfig public class TestUseRTMDeoptOptionOnUnsupportedConfig
extends RTMGenericCommandLineOptionTest { extends RTMGenericCommandLineOptionTest {
private static final String DEFAULT_VALUE = "false"; private static final String DEFAULT_VALUE = "false";
private TestUseRTMDeoptOptionOnUnsupportedConfig() { private TestUseRTMDeoptOptionOnUnsupportedConfig() {
super(new NotPredicate( super("UseRTMDeopt", true, false,
new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM())),
"UseRTMDeopt", true, false,
TestUseRTMDeoptOptionOnUnsupportedConfig.DEFAULT_VALUE, TestUseRTMDeoptOptionOnUnsupportedConfig.DEFAULT_VALUE,
"true"); "true");
} }
@ -77,6 +70,6 @@ public class TestUseRTMDeoptOptionOnUnsupportedConfig
} }
public static void main(String args[]) throws Throwable { public static void main(String args[]) throws Throwable {
new TestUseRTMDeoptOptionOnUnsupportedConfig().test(); new TestUseRTMDeoptOptionOnUnsupportedConfig().runTestCases();
} }
} }

View file

@ -29,7 +29,7 @@
* @library /test/lib / * @library /test/lib /
* @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.misc
* java.management * java.management
* * @requires vm.flavor == "server" & !vm.emulatedClient & vm.rtm.cpu & vm.rtm.os
* @build sun.hotspot.WhiteBox * @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission * sun.hotspot.WhiteBox$WhiteBoxPermission
@ -40,22 +40,12 @@
package compiler.rtm.cli; package compiler.rtm.cli;
import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.test.lib.process.ExitCode; import jdk.test.lib.process.ExitCode;
import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.CommandLineOptionTest;
import jdk.test.lib.cli.predicate.AndPredicate;
public class TestUseRTMForStackLocksOptionOnSupportedConfig public class TestUseRTMForStackLocksOptionOnSupportedConfig {
extends CommandLineOptionTest {
private static final String DEFAULT_VALUE = "false"; private static final String DEFAULT_VALUE = "false";
private TestUseRTMForStackLocksOptionOnSupportedConfig() {
super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM()));
}
@Override
public void runTestCases() throws Throwable { public void runTestCases() throws Throwable {
String errorMessage String errorMessage
= CommandLineOptionTest.getExperimentalOptionErrorMessage( = CommandLineOptionTest.getExperimentalOptionErrorMessage(
@ -127,6 +117,6 @@ public class TestUseRTMForStackLocksOptionOnSupportedConfig
} }
public static void main(String args[]) throws Throwable { public static void main(String args[]) throws Throwable {
new TestUseRTMForStackLocksOptionOnSupportedConfig().test(); new TestUseRTMForStackLocksOptionOnSupportedConfig().runTestCases();
} }
} }

View file

@ -29,7 +29,7 @@
* @library /test/lib / * @library /test/lib /
* @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.misc
* java.management * java.management
* * @requires !(vm.flavor == "server" & !vm.emulatedClient & vm.rtm.cpu & vm.rtm.os)
* @build sun.hotspot.WhiteBox * @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission * sun.hotspot.WhiteBox$WhiteBoxPermission
@ -40,22 +40,15 @@
package compiler.rtm.cli; package compiler.rtm.cli;
import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.test.lib.process.ExitCode; import jdk.test.lib.process.ExitCode;
import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.CommandLineOptionTest;
import jdk.test.lib.cli.predicate.AndPredicate;
import jdk.test.lib.cli.predicate.NotPredicate;
public class TestUseRTMForStackLocksOptionOnUnsupportedConfig public class TestUseRTMForStackLocksOptionOnUnsupportedConfig
extends RTMGenericCommandLineOptionTest { extends RTMGenericCommandLineOptionTest {
private static final String DEFAULT_VALUE = "false"; private static final String DEFAULT_VALUE = "false";
private TestUseRTMForStackLocksOptionOnUnsupportedConfig() { private TestUseRTMForStackLocksOptionOnUnsupportedConfig() {
super(new NotPredicate( super("UseRTMForStackLocks", true, true,
new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM())),
"UseRTMForStackLocks", true, true,
TestUseRTMForStackLocksOptionOnUnsupportedConfig.DEFAULT_VALUE, TestUseRTMForStackLocksOptionOnUnsupportedConfig.DEFAULT_VALUE,
"true"); "true");
} }
@ -111,6 +104,6 @@ public class TestUseRTMForStackLocksOptionOnUnsupportedConfig
} }
public static void main(String args[]) throws Throwable { public static void main(String args[]) throws Throwable {
new TestUseRTMForStackLocksOptionOnUnsupportedConfig().test(); new TestUseRTMForStackLocksOptionOnUnsupportedConfig().runTestCases();
} }
} }

View file

@ -29,7 +29,7 @@
* @library /test/lib / * @library /test/lib /
* @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.misc
* java.management * java.management
* * @requires vm.flavor == "server" & !vm.emulatedClient & vm.rtm.cpu & vm.rtm.os
* @build sun.hotspot.WhiteBox * @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission * sun.hotspot.WhiteBox$WhiteBoxPermission
@ -40,22 +40,12 @@
package compiler.rtm.cli; package compiler.rtm.cli;
import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.test.lib.process.ExitCode; import jdk.test.lib.process.ExitCode;
import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.CommandLineOptionTest;
import jdk.test.lib.cli.predicate.AndPredicate;
public class TestUseRTMLockingOptionOnSupportedConfig public class TestUseRTMLockingOptionOnSupportedConfig {
extends CommandLineOptionTest {
private static final String DEFAULT_VALUE = "false"; private static final String DEFAULT_VALUE = "false";
private TestUseRTMLockingOptionOnSupportedConfig() {
super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM()));
}
@Override
public void runTestCases() throws Throwable { public void runTestCases() throws Throwable {
String unrecongnizedOption String unrecongnizedOption
= CommandLineOptionTest.getUnrecognizedOptionErrorMessage( = CommandLineOptionTest.getUnrecognizedOptionErrorMessage(
@ -104,6 +94,6 @@ public class TestUseRTMLockingOptionOnSupportedConfig
} }
public static void main(String args[]) throws Throwable { public static void main(String args[]) throws Throwable {
new TestUseRTMLockingOptionOnSupportedConfig().test(); new TestUseRTMLockingOptionOnSupportedConfig().runTestCases();
} }
} }

View file

@ -29,7 +29,7 @@
* @library /test/lib / * @library /test/lib /
* @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.misc
* java.management * java.management
* * @requires (!vm.rtm.cpu) & (vm.flavor == "server" & !vm.emulatedClient)
* @build sun.hotspot.WhiteBox * @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission * sun.hotspot.WhiteBox$WhiteBoxPermission
@ -40,24 +40,13 @@
package compiler.rtm.cli; package compiler.rtm.cli;
import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.test.lib.process.ExitCode; import jdk.test.lib.process.ExitCode;
import jdk.test.lib.Platform; import jdk.test.lib.Platform;
import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.CommandLineOptionTest;
import jdk.test.lib.cli.predicate.AndPredicate;
import jdk.test.lib.cli.predicate.NotPredicate;
public class TestUseRTMLockingOptionOnUnsupportedCPU public class TestUseRTMLockingOptionOnUnsupportedCPU {
extends CommandLineOptionTest {
private static final String DEFAULT_VALUE = "false"; private static final String DEFAULT_VALUE = "false";
private TestUseRTMLockingOptionOnUnsupportedCPU() {
super(new AndPredicate(new NotPredicate(new SupportedCPU()),
new SupportedVM()));
}
@Override
public void runTestCases() throws Throwable { public void runTestCases() throws Throwable {
String unrecongnizedOption String unrecongnizedOption
= CommandLineOptionTest.getUnrecognizedOptionErrorMessage( = CommandLineOptionTest.getUnrecognizedOptionErrorMessage(
@ -107,6 +96,6 @@ public class TestUseRTMLockingOptionOnUnsupportedCPU
} }
public static void main(String args[]) throws Throwable { public static void main(String args[]) throws Throwable {
new TestUseRTMLockingOptionOnUnsupportedCPU().test(); new TestUseRTMLockingOptionOnUnsupportedCPU().runTestCases();
} }
} }

View file

@ -29,7 +29,7 @@
* @library /test/lib / * @library /test/lib /
* @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.misc
* java.management * java.management
* * @requires vm.rtm.cpu & !(vm.flavor == "server" & !vm.emulatedClient)
* @build sun.hotspot.WhiteBox * @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission * sun.hotspot.WhiteBox$WhiteBoxPermission
@ -40,22 +40,12 @@
package compiler.rtm.cli; package compiler.rtm.cli;
import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.test.lib.process.ExitCode; import jdk.test.lib.process.ExitCode;
import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.CommandLineOptionTest;
import jdk.test.lib.cli.predicate.AndPredicate;
import jdk.test.lib.cli.predicate.NotPredicate;
public class TestUseRTMLockingOptionOnUnsupportedVM public class TestUseRTMLockingOptionOnUnsupportedVM {
extends CommandLineOptionTest {
private static final String DEFAULT_VALUE = "false"; private static final String DEFAULT_VALUE = "false";
private TestUseRTMLockingOptionOnUnsupportedVM() {
super(new AndPredicate(new SupportedCPU(),
new NotPredicate(new SupportedVM())));
}
@Override
public void runTestCases() throws Throwable { public void runTestCases() throws Throwable {
String errorMessage String errorMessage
= RTMGenericCommandLineOptionTest.RTM_UNSUPPORTED_VM_ERROR; = RTMGenericCommandLineOptionTest.RTM_UNSUPPORTED_VM_ERROR;
@ -82,6 +72,6 @@ public class TestUseRTMLockingOptionOnUnsupportedVM
} }
public static void main(String args[]) throws Throwable { public static void main(String args[]) throws Throwable {
new TestUseRTMLockingOptionOnUnsupportedVM().test(); new TestUseRTMLockingOptionOnUnsupportedVM().runTestCases();
} }
} }

View file

@ -29,7 +29,7 @@
* @library /test/lib / * @library /test/lib /
* @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.misc
* java.management * java.management
* * @requires vm.flavor == "server" & !vm.emulatedClient & vm.rtm.cpu & vm.rtm.os
* @build sun.hotspot.WhiteBox * @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission * sun.hotspot.WhiteBox$WhiteBoxPermission
@ -40,20 +40,11 @@
package compiler.rtm.cli; package compiler.rtm.cli;
import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.test.lib.process.ExitCode; import jdk.test.lib.process.ExitCode;
import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.CommandLineOptionTest;
import jdk.test.lib.cli.predicate.AndPredicate;
public class TestUseRTMLockingOptionWithBiasedLocking public class TestUseRTMLockingOptionWithBiasedLocking {
extends CommandLineOptionTest {
private TestUseRTMLockingOptionWithBiasedLocking() {
super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM()));
}
@Override
public void runTestCases() throws Throwable { public void runTestCases() throws Throwable {
String warningMessage String warningMessage
= RTMGenericCommandLineOptionTest.RTM_BIASED_LOCKING_WARNING; = RTMGenericCommandLineOptionTest.RTM_BIASED_LOCKING_WARNING;
@ -98,6 +89,6 @@ public class TestUseRTMLockingOptionWithBiasedLocking
} }
public static void main(String args[]) throws Throwable { public static void main(String args[]) throws Throwable {
new TestUseRTMLockingOptionWithBiasedLocking().test(); new TestUseRTMLockingOptionWithBiasedLocking().runTestCases();
} }
} }

View file

@ -39,11 +39,11 @@ public class TestUseRTMXendForLockBusyOption
private static final String DEFAULT_VALUE = "true"; private static final String DEFAULT_VALUE = "true";
public TestUseRTMXendForLockBusyOption() { public TestUseRTMXendForLockBusyOption() {
super(Boolean.TRUE::booleanValue, "UseRTMXendForLockBusy", true, true, super("UseRTMXendForLockBusy", true, true,
TestUseRTMXendForLockBusyOption.DEFAULT_VALUE, "true"); TestUseRTMXendForLockBusyOption.DEFAULT_VALUE, "true");
} }
public static void main(String agrs[]) throws Throwable { public static void main(String agrs[]) throws Throwable {
new TestUseRTMXendForLockBusyOption().test(); new TestUseRTMXendForLockBusyOption().runTestCases();
} }
} }

View file

@ -29,6 +29,7 @@
* @library /test/lib / * @library /test/lib /
* @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.misc
* java.management * java.management
* @requires vm.flavor == "server" & !vm.emulatedClient & vm.rtm.cpu & vm.rtm.os
* @build sun.hotspot.WhiteBox * @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission * sun.hotspot.WhiteBox$WhiteBoxPermission
@ -43,14 +44,10 @@ import compiler.testlibrary.rtm.AbortProvoker;
import compiler.testlibrary.rtm.CompilableTest; import compiler.testlibrary.rtm.CompilableTest;
import compiler.testlibrary.rtm.RTMLockingStatistics; import compiler.testlibrary.rtm.RTMLockingStatistics;
import compiler.testlibrary.rtm.RTMTestBase; import compiler.testlibrary.rtm.RTMTestBase;
import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.internal.misc.Unsafe; import jdk.internal.misc.Unsafe;
import jdk.test.lib.Asserts; import jdk.test.lib.Asserts;
import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.CommandLineOptionTest;
import jdk.test.lib.cli.predicate.AndPredicate;
import java.util.List; import java.util.List;
@ -58,12 +55,8 @@ import java.util.List;
* Test verifies that method will be deoptimized on high abort ratio * Test verifies that method will be deoptimized on high abort ratio
* as soon as abort ratio reaches RTMAbortRatio's value. * as soon as abort ratio reaches RTMAbortRatio's value.
*/ */
public class TestRTMAbortRatio extends CommandLineOptionTest { public class TestRTMAbortRatio {
private TestRTMAbortRatio() {
super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM()));
}
@Override
protected void runTestCases() throws Throwable { protected void runTestCases() throws Throwable {
verifyAbortRatio(0, false); verifyAbortRatio(0, false);
verifyAbortRatio(10, false); verifyAbortRatio(10, false);
@ -167,7 +160,7 @@ public class TestRTMAbortRatio extends CommandLineOptionTest {
} }
public static void main(String args[]) throws Throwable { public static void main(String args[]) throws Throwable {
new TestRTMAbortRatio().test(); new TestRTMAbortRatio().runTestCases();
} }
} }

View file

@ -29,6 +29,7 @@
* @library /test/lib / * @library /test/lib /
* @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.misc
* java.management * java.management
* @requires vm.flavor == "server" & !vm.emulatedClient & vm.rtm.cpu & vm.rtm.os
* @build sun.hotspot.WhiteBox * @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission * sun.hotspot.WhiteBox$WhiteBoxPermission
@ -43,13 +44,9 @@ import compiler.testlibrary.rtm.AbortProvoker;
import compiler.testlibrary.rtm.AbortType; import compiler.testlibrary.rtm.AbortType;
import compiler.testlibrary.rtm.RTMLockingStatistics; import compiler.testlibrary.rtm.RTMLockingStatistics;
import compiler.testlibrary.rtm.RTMTestBase; import compiler.testlibrary.rtm.RTMTestBase;
import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.test.lib.Asserts; import jdk.test.lib.Asserts;
import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.CommandLineOptionTest;
import jdk.test.lib.cli.predicate.AndPredicate;
import java.util.List; import java.util.List;
@ -57,12 +54,8 @@ import java.util.List;
* Test verifies that on RTMAbortThreshold option actually affects how soon * Test verifies that on RTMAbortThreshold option actually affects how soon
* method will be deoptimized on high abort ratio. * method will be deoptimized on high abort ratio.
*/ */
public class TestRTMAbortThreshold extends CommandLineOptionTest { public class TestRTMAbortThreshold {
private TestRTMAbortThreshold() {
super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM()));
}
@Override
protected void runTestCases() throws Throwable { protected void runTestCases() throws Throwable {
verifyAbortThreshold(false, 1); verifyAbortThreshold(false, 1);
verifyAbortThreshold(false, 10); verifyAbortThreshold(false, 10);
@ -107,7 +100,7 @@ public class TestRTMAbortThreshold extends CommandLineOptionTest {
} }
public static void main(String args[]) throws Throwable { public static void main(String args[]) throws Throwable {
new TestRTMAbortThreshold().test(); new TestRTMAbortThreshold().runTestCases();
} }
} }

View file

@ -31,6 +31,7 @@
* @library /test/lib / * @library /test/lib /
* @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.misc
* java.management * java.management
* @requires vm.flavor == "server" & !vm.emulatedClient & vm.rtm.cpu & vm.rtm.os
* @build sun.hotspot.WhiteBox * @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission * sun.hotspot.WhiteBox$WhiteBoxPermission
@ -45,14 +46,10 @@ import compiler.testlibrary.rtm.AbortProvoker;
import compiler.testlibrary.rtm.CompilableTest; import compiler.testlibrary.rtm.CompilableTest;
import compiler.testlibrary.rtm.RTMLockingStatistics; import compiler.testlibrary.rtm.RTMLockingStatistics;
import compiler.testlibrary.rtm.RTMTestBase; import compiler.testlibrary.rtm.RTMTestBase;
import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.internal.misc.Unsafe; import jdk.internal.misc.Unsafe;
import jdk.test.lib.Asserts; import jdk.test.lib.Asserts;
import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.CommandLineOptionTest;
import jdk.test.lib.cli.predicate.AndPredicate;
import java.util.List; import java.util.List;
@ -81,15 +78,10 @@ import java.util.List;
* ratio will be below 100% and there should be enough lock * ratio will be below 100% and there should be enough lock
* attempts to recompile method without RTM profiling. * attempts to recompile method without RTM profiling.
*/ */
public class TestRTMAfterNonRTMDeopt extends CommandLineOptionTest { public class TestRTMAfterNonRTMDeopt {
private static final int ABORT_THRESHOLD = 1000; private static final int ABORT_THRESHOLD = 1000;
private static final String RANGE_CHECK = "range_check"; private static final String RANGE_CHECK = "range_check";
private TestRTMAfterNonRTMDeopt() {
super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM()));
}
@Override
protected void runTestCases() throws Throwable { protected void runTestCases() throws Throwable {
verifyRTMAfterDeopt(false, false); verifyRTMAfterDeopt(false, false);
verifyRTMAfterDeopt(true, false); verifyRTMAfterDeopt(true, false);
@ -214,7 +206,7 @@ public class TestRTMAfterNonRTMDeopt extends CommandLineOptionTest {
} }
public static void main(String args[]) throws Throwable { public static void main(String args[]) throws Throwable {
new TestRTMAfterNonRTMDeopt().test(); new TestRTMAfterNonRTMDeopt().runTestCases();
} }
} }

View file

@ -29,6 +29,7 @@
* @library /test/lib / * @library /test/lib /
* @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.misc
* java.management * java.management
* @requires vm.flavor == "server" & !vm.emulatedClient & vm.rtm.cpu & vm.rtm.os
* @build sun.hotspot.WhiteBox * @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission * sun.hotspot.WhiteBox$WhiteBoxPermission
@ -43,13 +44,9 @@ import compiler.testlibrary.rtm.AbortProvoker;
import compiler.testlibrary.rtm.AbortType; import compiler.testlibrary.rtm.AbortType;
import compiler.testlibrary.rtm.RTMLockingStatistics; import compiler.testlibrary.rtm.RTMLockingStatistics;
import compiler.testlibrary.rtm.RTMTestBase; import compiler.testlibrary.rtm.RTMTestBase;
import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.test.lib.Asserts; import jdk.test.lib.Asserts;
import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.CommandLineOptionTest;
import jdk.test.lib.cli.predicate.AndPredicate;
import java.util.List; import java.util.List;
@ -61,15 +58,10 @@ import java.util.List;
* so in order to avoid issue with retriable locks -XX:RTMRetryCount=0 is used. * so in order to avoid issue with retriable locks -XX:RTMRetryCount=0 is used.
* For more details on that issue see {@link TestUseRTMAfterLockInflation}. * For more details on that issue see {@link TestUseRTMAfterLockInflation}.
*/ */
public class TestRTMDeoptOnHighAbortRatio extends CommandLineOptionTest { public class TestRTMDeoptOnHighAbortRatio {
private static final long ABORT_THRESHOLD private static final long ABORT_THRESHOLD
= AbortProvoker.DEFAULT_ITERATIONS / 2L; = AbortProvoker.DEFAULT_ITERATIONS / 2L;
private TestRTMDeoptOnHighAbortRatio() {
super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM()));
}
@Override
protected void runTestCases() throws Throwable { protected void runTestCases() throws Throwable {
verifyDeopt(false); verifyDeopt(false);
verifyDeopt(true); verifyDeopt(true);
@ -119,7 +111,7 @@ public class TestRTMDeoptOnHighAbortRatio extends CommandLineOptionTest {
} }
public static void main(String args[]) throws Throwable { public static void main(String args[]) throws Throwable {
new TestRTMDeoptOnHighAbortRatio().test(); new TestRTMDeoptOnHighAbortRatio().runTestCases();
} }
} }

View file

@ -28,6 +28,7 @@
* @library /test/lib / * @library /test/lib /
* @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.misc
* java.management * java.management
* @requires vm.flavor == "server" & !vm.emulatedClient & vm.rtm.cpu & vm.rtm.os
* @build sun.hotspot.WhiteBox * @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission * sun.hotspot.WhiteBox$WhiteBoxPermission
@ -42,14 +43,10 @@ import compiler.testlibrary.rtm.AbortProvoker;
import compiler.testlibrary.rtm.CompilableTest; import compiler.testlibrary.rtm.CompilableTest;
import compiler.testlibrary.rtm.RTMLockingStatistics; import compiler.testlibrary.rtm.RTMLockingStatistics;
import compiler.testlibrary.rtm.RTMTestBase; import compiler.testlibrary.rtm.RTMTestBase;
import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.internal.misc.Unsafe; import jdk.internal.misc.Unsafe;
import jdk.test.lib.Asserts; import jdk.test.lib.Asserts;
import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.CommandLineOptionTest;
import jdk.test.lib.cli.predicate.AndPredicate;
import java.util.List; import java.util.List;
@ -61,15 +58,10 @@ import java.util.List;
* so in order to avoid issue with retriable locks -XX:RTMRetryCount=0 is used. * so in order to avoid issue with retriable locks -XX:RTMRetryCount=0 is used.
* For more details on that issue see {@link TestUseRTMAfterLockInflation}. * For more details on that issue see {@link TestUseRTMAfterLockInflation}.
*/ */
public class TestRTMDeoptOnLowAbortRatio extends CommandLineOptionTest { public class TestRTMDeoptOnLowAbortRatio {
private static final long LOCKING_THRESHOLD = 100L; private static final long LOCKING_THRESHOLD = 100L;
private static final long ABORT_THRESHOLD = LOCKING_THRESHOLD / 2L; private static final long ABORT_THRESHOLD = LOCKING_THRESHOLD / 2L;
private TestRTMDeoptOnLowAbortRatio() {
super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM()));
}
@Override
protected void runTestCases() throws Throwable { protected void runTestCases() throws Throwable {
verifyRTMDeopt(false); verifyRTMDeopt(false);
verifyRTMDeopt(true); verifyRTMDeopt(true);
@ -172,6 +164,6 @@ public class TestRTMDeoptOnLowAbortRatio extends CommandLineOptionTest {
} }
public static void main(String args[]) throws Throwable { public static void main(String args[]) throws Throwable {
new TestRTMDeoptOnLowAbortRatio().test(); new TestRTMDeoptOnLowAbortRatio().runTestCases();
} }
} }

View file

@ -29,6 +29,7 @@
* @library /test/lib / * @library /test/lib /
* @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.misc
* java.management * java.management
* @requires vm.flavor == "server" & !vm.emulatedClient & vm.rtm.cpu & vm.rtm.os
* @build sun.hotspot.WhiteBox * @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission * sun.hotspot.WhiteBox$WhiteBoxPermission
@ -42,26 +43,17 @@ package compiler.rtm.locking;
import compiler.testlibrary.rtm.AbortProvoker; import compiler.testlibrary.rtm.AbortProvoker;
import compiler.testlibrary.rtm.AbortType; import compiler.testlibrary.rtm.AbortType;
import compiler.testlibrary.rtm.RTMTestBase; import compiler.testlibrary.rtm.RTMTestBase;
import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.test.lib.Asserts; import jdk.test.lib.Asserts;
import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.CommandLineOptionTest;
import jdk.test.lib.cli.predicate.AndPredicate;
/** /**
* Test verifies that abort ratio calculation could be delayed using * Test verifies that abort ratio calculation could be delayed using
* RTMLockingCalculationDelay option. * RTMLockingCalculationDelay option.
*/ */
public class TestRTMLockingCalculationDelay extends CommandLineOptionTest { public class TestRTMLockingCalculationDelay {
private static final boolean INFLATE_MONITOR = true; private static final boolean INFLATE_MONITOR = true;
private TestRTMLockingCalculationDelay() {
super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM()));
}
@Override
protected void runTestCases() throws Throwable { protected void runTestCases() throws Throwable {
// verify that calculation will be started immediately // verify that calculation will be started immediately
verifyLockingCalculationDelay(0, 0, true); verifyLockingCalculationDelay(0, 0, true);
@ -110,6 +102,6 @@ public class TestRTMLockingCalculationDelay extends CommandLineOptionTest {
} }
public static void main(String args[]) throws Throwable { public static void main(String args[]) throws Throwable {
new TestRTMLockingCalculationDelay().test(); new TestRTMLockingCalculationDelay().runTestCases();
} }
} }

View file

@ -29,6 +29,7 @@
* @library /test/lib / * @library /test/lib /
* @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.misc
* java.management * java.management
* @requires vm.flavor == "server" & !vm.emulatedClient & vm.rtm.cpu & vm.rtm.os
* @build sun.hotspot.WhiteBox * @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission * sun.hotspot.WhiteBox$WhiteBoxPermission
@ -43,14 +44,10 @@ import compiler.testlibrary.rtm.AbortProvoker;
import compiler.testlibrary.rtm.CompilableTest; import compiler.testlibrary.rtm.CompilableTest;
import compiler.testlibrary.rtm.RTMLockingStatistics; import compiler.testlibrary.rtm.RTMLockingStatistics;
import compiler.testlibrary.rtm.RTMTestBase; import compiler.testlibrary.rtm.RTMTestBase;
import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.internal.misc.Unsafe; import jdk.internal.misc.Unsafe;
import jdk.test.lib.Asserts; import jdk.test.lib.Asserts;
import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.CommandLineOptionTest;
import jdk.test.lib.cli.predicate.AndPredicate;
import java.util.List; import java.util.List;
@ -58,10 +55,7 @@ import java.util.List;
* Test verifies that RTMLockingThreshold option actually affects how soon * Test verifies that RTMLockingThreshold option actually affects how soon
* method will be deoptimized on low abort ratio. * method will be deoptimized on low abort ratio.
*/ */
public class TestRTMLockingThreshold extends CommandLineOptionTest { public class TestRTMLockingThreshold {
private TestRTMLockingThreshold() {
super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM()));
}
/** /**
* We use non-zero abort threshold to avoid abort related to * We use non-zero abort threshold to avoid abort related to
@ -70,7 +64,6 @@ public class TestRTMLockingThreshold extends CommandLineOptionTest {
*/ */
private static final int MIN_ABORT_THRESHOLD = 10; private static final int MIN_ABORT_THRESHOLD = 10;
@Override
protected void runTestCases() throws Throwable { protected void runTestCases() throws Throwable {
verifyLockingThreshold(0, false); verifyLockingThreshold(0, false);
verifyLockingThreshold(100, false); verifyLockingThreshold(100, false);
@ -183,6 +176,6 @@ public class TestRTMLockingThreshold extends CommandLineOptionTest {
} }
public static void main(String args[]) throws Throwable { public static void main(String args[]) throws Throwable {
new TestRTMLockingThreshold().test(); new TestRTMLockingThreshold().runTestCases();
} }
} }

View file

@ -28,6 +28,7 @@
* @library /test/lib / * @library /test/lib /
* @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.misc
* java.management * java.management
* @requires vm.flavor == "server" & !vm.emulatedClient & vm.rtm.cpu & vm.rtm.os
* @build sun.hotspot.WhiteBox * @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission * sun.hotspot.WhiteBox$WhiteBoxPermission
@ -42,13 +43,9 @@ import compiler.testlibrary.rtm.BusyLock;
import compiler.testlibrary.rtm.CompilableTest; import compiler.testlibrary.rtm.CompilableTest;
import compiler.testlibrary.rtm.RTMLockingStatistics; import compiler.testlibrary.rtm.RTMLockingStatistics;
import compiler.testlibrary.rtm.RTMTestBase; import compiler.testlibrary.rtm.RTMTestBase;
import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.test.lib.Asserts; import jdk.test.lib.Asserts;
import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.CommandLineOptionTest;
import jdk.test.lib.cli.predicate.AndPredicate;
import java.util.List; import java.util.List;
@ -56,18 +53,13 @@ import java.util.List;
* Test verifies that RTMRetryCount option actually affects amount of * Test verifies that RTMRetryCount option actually affects amount of
* retries on lock busy. * retries on lock busy.
*/ */
public class TestRTMRetryCount extends CommandLineOptionTest { public class TestRTMRetryCount {
/** /**
* Time in ms, during which busy lock will be locked. * Time in ms, during which busy lock will be locked.
*/ */
private static final int LOCKING_TIME = 5000; private static final int LOCKING_TIME = 5000;
private static final boolean INFLATE_MONITOR = true; private static final boolean INFLATE_MONITOR = true;
private TestRTMRetryCount() {
super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM()));
}
@Override
protected void runTestCases() throws Throwable { protected void runTestCases() throws Throwable {
verifyRTMRetryCount(0); verifyRTMRetryCount(0);
verifyRTMRetryCount(1); verifyRTMRetryCount(1);
@ -107,6 +99,6 @@ public class TestRTMRetryCount extends CommandLineOptionTest {
} }
public static void main(String args[]) throws Throwable { public static void main(String args[]) throws Throwable {
new TestRTMRetryCount().test(); new TestRTMRetryCount().runTestCases();
} }
} }

View file

@ -29,6 +29,7 @@
* @library /test/lib / * @library /test/lib /
* @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.misc
* java.management * java.management
* @requires vm.flavor == "server" & !vm.emulatedClient & vm.rtm.cpu & vm.rtm.os
* @build sun.hotspot.WhiteBox * @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission * sun.hotspot.WhiteBox$WhiteBoxPermission
@ -43,13 +44,9 @@ import compiler.testlibrary.rtm.BusyLock;
import compiler.testlibrary.rtm.CompilableTest; import compiler.testlibrary.rtm.CompilableTest;
import compiler.testlibrary.rtm.RTMLockingStatistics; import compiler.testlibrary.rtm.RTMLockingStatistics;
import compiler.testlibrary.rtm.RTMTestBase; import compiler.testlibrary.rtm.RTMTestBase;
import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.test.lib.Asserts; import jdk.test.lib.Asserts;
import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.CommandLineOptionTest;
import jdk.test.lib.cli.predicate.AndPredicate;
import java.util.List; import java.util.List;
@ -57,7 +54,7 @@ import java.util.List;
* Test verifies that RTMSpinLoopCount increase time spent between retries * Test verifies that RTMSpinLoopCount increase time spent between retries
* by comparing amount of retries done with different RTMSpinLoopCount's values. * by comparing amount of retries done with different RTMSpinLoopCount's values.
*/ */
public class TestRTMSpinLoopCount extends CommandLineOptionTest { public class TestRTMSpinLoopCount {
private static final int LOCKING_TIME = 1000; private static final int LOCKING_TIME = 1000;
private static final int RTM_RETRY_COUNT = 1000; private static final int RTM_RETRY_COUNT = 1000;
private static final boolean INFLATE_MONITOR = true; private static final boolean INFLATE_MONITOR = true;
@ -65,11 +62,6 @@ public class TestRTMSpinLoopCount extends CommandLineOptionTest {
private static final int[] SPIN_LOOP_COUNTS private static final int[] SPIN_LOOP_COUNTS
= new int[] { 0, 100, 1_000, 1_000_000, 10_000_000 }; = new int[] { 0, 100, 1_000, 1_000_000, 10_000_000 };
private TestRTMSpinLoopCount() {
super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM()));
}
@Override
protected void runTestCases() throws Throwable { protected void runTestCases() throws Throwable {
long[] aborts = new long[TestRTMSpinLoopCount.SPIN_LOOP_COUNTS.length]; long[] aborts = new long[TestRTMSpinLoopCount.SPIN_LOOP_COUNTS.length];
for (int i = 0; i < TestRTMSpinLoopCount.SPIN_LOOP_COUNTS.length; i++) { for (int i = 0; i < TestRTMSpinLoopCount.SPIN_LOOP_COUNTS.length; i++) {
@ -121,6 +113,6 @@ public class TestRTMSpinLoopCount extends CommandLineOptionTest {
} }
public static void main(String args[]) throws Throwable { public static void main(String args[]) throws Throwable {
new TestRTMSpinLoopCount().test(); new TestRTMSpinLoopCount().runTestCases();
} }
} }

View file

@ -29,6 +29,7 @@
* @library /test/lib / * @library /test/lib /
* @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.misc
* java.management * java.management
* @requires vm.flavor == "server" & !vm.emulatedClient & vm.rtm.cpu & vm.rtm.os
* @build sun.hotspot.WhiteBox * @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission * sun.hotspot.WhiteBox$WhiteBoxPermission
@ -43,14 +44,10 @@ import compiler.testlibrary.rtm.AbortProvoker;
import compiler.testlibrary.rtm.CompilableTest; import compiler.testlibrary.rtm.CompilableTest;
import compiler.testlibrary.rtm.RTMLockingStatistics; import compiler.testlibrary.rtm.RTMLockingStatistics;
import compiler.testlibrary.rtm.RTMTestBase; import compiler.testlibrary.rtm.RTMTestBase;
import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.internal.misc.Unsafe; import jdk.internal.misc.Unsafe;
import jdk.test.lib.Asserts; import jdk.test.lib.Asserts;
import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.CommandLineOptionTest;
import jdk.test.lib.cli.predicate.AndPredicate;
import java.util.List; import java.util.List;
@ -62,12 +59,7 @@ import java.util.List;
* -XX:RTMRetryCount=0 to avoid issue with retriable aborts. For more details on * -XX:RTMRetryCount=0 to avoid issue with retriable aborts. For more details on
* that issue see {@link TestUseRTMAfterLockInflation}. * that issue see {@link TestUseRTMAfterLockInflation}.
*/ */
public class TestRTMTotalCountIncrRate extends CommandLineOptionTest { public class TestRTMTotalCountIncrRate {
private TestRTMTotalCountIncrRate() {
super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM()));
}
@Override
protected void runTestCases() throws Throwable { protected void runTestCases() throws Throwable {
verifyLocksCount(1, false); verifyLocksCount(1, false);
verifyLocksCount(64, false); verifyLocksCount(64, false);
@ -167,6 +159,6 @@ public class TestRTMTotalCountIncrRate extends CommandLineOptionTest {
} }
public static void main(String args[]) throws Throwable { public static void main(String args[]) throws Throwable {
new TestRTMTotalCountIncrRate().test(); new TestRTMTotalCountIncrRate().runTestCases();
} }
} }

View file

@ -29,6 +29,7 @@
* @library /test/lib / * @library /test/lib /
* @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.misc
* java.management * java.management
* @requires vm.flavor == "server" & !vm.emulatedClient & vm.rtm.cpu & vm.rtm.os
* @build sun.hotspot.WhiteBox * @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission * sun.hotspot.WhiteBox$WhiteBoxPermission
@ -43,13 +44,8 @@ import compiler.testlibrary.rtm.AbortProvoker;
import compiler.testlibrary.rtm.AbortType; import compiler.testlibrary.rtm.AbortType;
import compiler.testlibrary.rtm.RTMLockingStatistics; import compiler.testlibrary.rtm.RTMLockingStatistics;
import compiler.testlibrary.rtm.RTMTestBase; import compiler.testlibrary.rtm.RTMTestBase;
import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.test.lib.Asserts; import jdk.test.lib.Asserts;
import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.cli.CommandLineOptionTest;
import jdk.test.lib.cli.predicate.AndPredicate;
import java.util.List; import java.util.List;
@ -68,15 +64,10 @@ import java.util.List;
* reasons simultaneously. In order to avoid false negative failures related * reasons simultaneously. In order to avoid false negative failures related
* to incorrect aborts counting, -XX:RTMRetryCount=0 is used. * to incorrect aborts counting, -XX:RTMRetryCount=0 is used.
*/ */
public class TestUseRTMAfterLockInflation extends CommandLineOptionTest { public class TestUseRTMAfterLockInflation {
private static final long EXPECTED_LOCKS private static final long EXPECTED_LOCKS
= 2L * AbortProvoker.DEFAULT_ITERATIONS; = 2L * AbortProvoker.DEFAULT_ITERATIONS;
private TestUseRTMAfterLockInflation() {
super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM()));
}
@Override
protected void runTestCases() throws Throwable { protected void runTestCases() throws Throwable {
AbortProvoker provoker = AbortType.XABORT.provoker(); AbortProvoker provoker = AbortType.XABORT.provoker();
long totalLocksCount = 0; long totalLocksCount = 0;
@ -133,6 +124,6 @@ public class TestUseRTMAfterLockInflation extends CommandLineOptionTest {
} }
public static void main(String args[]) throws Throwable { public static void main(String args[]) throws Throwable {
new TestUseRTMAfterLockInflation().test(); new TestUseRTMAfterLockInflation().runTestCases();
} }
} }

View file

@ -29,6 +29,7 @@
* @library /test/lib / * @library /test/lib /
* @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.misc
* java.management * java.management
* @requires vm.flavor == "server" & !vm.emulatedClient & vm.rtm.cpu & vm.rtm.os
* @build sun.hotspot.WhiteBox * @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission * sun.hotspot.WhiteBox$WhiteBoxPermission
@ -42,24 +43,16 @@ package compiler.rtm.locking;
import compiler.testlibrary.rtm.AbortProvoker; import compiler.testlibrary.rtm.AbortProvoker;
import compiler.testlibrary.rtm.AbortType; import compiler.testlibrary.rtm.AbortType;
import compiler.testlibrary.rtm.RTMTestBase; import compiler.testlibrary.rtm.RTMTestBase;
import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.test.lib.Asserts; import jdk.test.lib.Asserts;
import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.CommandLineOptionTest;
import jdk.test.lib.cli.predicate.AndPredicate;
/** /**
* Test verifies that usage of UseRTMDeopt option affects uncommon traps usage * Test verifies that usage of UseRTMDeopt option affects uncommon traps usage
* for methods that use locking. * for methods that use locking.
*/ */
public class TestUseRTMDeopt extends CommandLineOptionTest { public class TestUseRTMDeopt {
private TestUseRTMDeopt() {
super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM()));
}
@Override
protected void runTestCases() throws Throwable { protected void runTestCases() throws Throwable {
verifyUseRTMDeopt(false); verifyUseRTMDeopt(false);
verifyUseRTMDeopt(true); verifyUseRTMDeopt(true);
@ -92,6 +85,6 @@ public class TestUseRTMDeopt extends CommandLineOptionTest {
} }
public static void main(String args[]) throws Throwable { public static void main(String args[]) throws Throwable {
new TestUseRTMDeopt().test(); new TestUseRTMDeopt().runTestCases();
} }
} }

View file

@ -28,6 +28,7 @@
* @library /test/lib / * @library /test/lib /
* @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.misc
* java.management * java.management
* @requires vm.flavor == "server" & !vm.emulatedClient & vm.rtm.cpu & vm.rtm.os
* @build sun.hotspot.WhiteBox * @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission * sun.hotspot.WhiteBox$WhiteBoxPermission
@ -41,13 +42,8 @@ import compiler.testlibrary.rtm.AbortProvoker;
import compiler.testlibrary.rtm.AbortType; import compiler.testlibrary.rtm.AbortType;
import compiler.testlibrary.rtm.RTMLockingStatistics; import compiler.testlibrary.rtm.RTMLockingStatistics;
import compiler.testlibrary.rtm.RTMTestBase; import compiler.testlibrary.rtm.RTMTestBase;
import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.test.lib.Asserts; import jdk.test.lib.Asserts;
import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.cli.CommandLineOptionTest;
import jdk.test.lib.cli.predicate.AndPredicate;
import java.util.List; import java.util.List;
@ -61,12 +57,8 @@ import java.util.List;
* is used. For more information abort that issue see * is used. For more information abort that issue see
* {@link TestUseRTMAfterLockInflation}. * {@link TestUseRTMAfterLockInflation}.
*/ */
public class TestUseRTMForInflatedLocks extends CommandLineOptionTest { public class TestUseRTMForInflatedLocks {
private TestUseRTMForInflatedLocks() {
super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM()));
}
@Override
protected void runTestCases() throws Throwable { protected void runTestCases() throws Throwable {
AbortProvoker provoker = AbortType.XABORT.provoker(); AbortProvoker provoker = AbortType.XABORT.provoker();
RTMLockingStatistics lock; RTMLockingStatistics lock;
@ -96,6 +88,6 @@ public class TestUseRTMForInflatedLocks extends CommandLineOptionTest {
} }
public static void main(String args[]) throws Throwable { public static void main(String args[]) throws Throwable {
new TestUseRTMForInflatedLocks().test(); new TestUseRTMForInflatedLocks().runTestCases();
} }
} }

View file

@ -28,6 +28,7 @@
* @library /test/lib / * @library /test/lib /
* @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.misc
* java.management * java.management
* @requires vm.flavor == "server" & !vm.emulatedClient & vm.rtm.cpu & vm.rtm.os
* @build sun.hotspot.WhiteBox * @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission * sun.hotspot.WhiteBox$WhiteBoxPermission
@ -42,13 +43,8 @@ import compiler.testlibrary.rtm.AbortProvoker;
import compiler.testlibrary.rtm.AbortType; import compiler.testlibrary.rtm.AbortType;
import compiler.testlibrary.rtm.RTMLockingStatistics; import compiler.testlibrary.rtm.RTMLockingStatistics;
import compiler.testlibrary.rtm.RTMTestBase; import compiler.testlibrary.rtm.RTMTestBase;
import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.test.lib.Asserts; import jdk.test.lib.Asserts;
import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.cli.CommandLineOptionTest;
import jdk.test.lib.cli.predicate.AndPredicate;
import java.util.List; import java.util.List;
@ -62,14 +58,9 @@ import java.util.List;
* is used. For more information abort that issue see * is used. For more information abort that issue see
* {@link TestUseRTMAfterLockInflation}. * {@link TestUseRTMAfterLockInflation}.
*/ */
public class TestUseRTMForStackLocks extends CommandLineOptionTest { public class TestUseRTMForStackLocks {
private static final boolean INFLATE_MONITOR = false; private static final boolean INFLATE_MONITOR = false;
private TestUseRTMForStackLocks() {
super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM()));
}
@Override
protected void runTestCases() throws Throwable { protected void runTestCases() throws Throwable {
AbortProvoker provoker = AbortType.XABORT.provoker(); AbortProvoker provoker = AbortType.XABORT.provoker();
RTMLockingStatistics lock; RTMLockingStatistics lock;
@ -100,6 +91,6 @@ public class TestUseRTMForStackLocks extends CommandLineOptionTest {
} }
public static void main(String args[]) throws Throwable { public static void main(String args[]) throws Throwable {
new TestUseRTMForStackLocks().test(); new TestUseRTMForStackLocks().runTestCases();
} }
} }

View file

@ -29,6 +29,7 @@
* @library /test/lib / * @library /test/lib /
* @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.misc
* java.management * java.management
* @requires vm.flavor == "server" & !vm.emulatedClient & vm.rtm.cpu & vm.rtm.os
* @build sun.hotspot.WhiteBox * @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission * sun.hotspot.WhiteBox$WhiteBoxPermission
@ -44,13 +45,9 @@ import compiler.testlibrary.rtm.BusyLock;
import compiler.testlibrary.rtm.CompilableTest; import compiler.testlibrary.rtm.CompilableTest;
import compiler.testlibrary.rtm.RTMLockingStatistics; import compiler.testlibrary.rtm.RTMLockingStatistics;
import compiler.testlibrary.rtm.RTMTestBase; import compiler.testlibrary.rtm.RTMTestBase;
import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.test.lib.Asserts; import jdk.test.lib.Asserts;
import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.CommandLineOptionTest;
import jdk.test.lib.cli.predicate.AndPredicate;
import java.util.List; import java.util.List;
@ -58,14 +55,9 @@ import java.util.List;
* Test verifies that with +UseRTMXendForLockBusy there will be no aborts * Test verifies that with +UseRTMXendForLockBusy there will be no aborts
* forced by the test. * forced by the test.
*/ */
public class TestUseRTMXendForLockBusy extends CommandLineOptionTest { public class TestUseRTMXendForLockBusy {
private final static int LOCKING_TIME = 5000; private final static int LOCKING_TIME = 5000;
private TestUseRTMXendForLockBusy() {
super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM()));
}
@Override
protected void runTestCases() throws Throwable { protected void runTestCases() throws Throwable {
// inflated lock, xabort on lock busy // inflated lock, xabort on lock busy
verifyXendForLockBusy(true, false); verifyXendForLockBusy(true, false);
@ -117,6 +109,6 @@ public class TestUseRTMXendForLockBusy extends CommandLineOptionTest {
} }
public static void main(String args[]) throws Throwable { public static void main(String args[]) throws Throwable {
new TestUseRTMXendForLockBusy().test(); new TestUseRTMXendForLockBusy().runTestCases();
} }
} }

View file

@ -29,6 +29,7 @@
* @library /test/lib / * @library /test/lib /
* @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.misc
* java.management * java.management
* @requires vm.flavor == "server" & !vm.emulatedClient & vm.rtm.cpu & vm.rtm.os
* @build sun.hotspot.WhiteBox * @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission * sun.hotspot.WhiteBox$WhiteBoxPermission
@ -43,13 +44,9 @@ import compiler.testlibrary.rtm.AbortProvoker;
import compiler.testlibrary.rtm.AbortType; import compiler.testlibrary.rtm.AbortType;
import compiler.testlibrary.rtm.RTMLockingStatistics; import compiler.testlibrary.rtm.RTMLockingStatistics;
import compiler.testlibrary.rtm.RTMTestBase; import compiler.testlibrary.rtm.RTMTestBase;
import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.test.lib.Asserts; import jdk.test.lib.Asserts;
import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.CommandLineOptionTest;
import jdk.test.lib.cli.predicate.AndPredicate;
import java.util.List; import java.util.List;
@ -60,12 +57,8 @@ import java.util.List;
* <i>rtm_state_change</i> reason had happened and that that VM output * <i>rtm_state_change</i> reason had happened and that that VM output
* does not contain RTM locking statistics for compiled method. * does not contain RTM locking statistics for compiled method.
*/ */
public class TestNoRTMLockElidingOption extends CommandLineOptionTest { public class TestNoRTMLockElidingOption {
private TestNoRTMLockElidingOption() {
super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM()));
}
@Override
public void runTestCases() throws Throwable { public void runTestCases() throws Throwable {
verifyOption(false); verifyOption(false);
verifyOption(true); verifyOption(true);
@ -108,6 +101,6 @@ public class TestNoRTMLockElidingOption extends CommandLineOptionTest {
} }
public static void main(String args[]) throws Throwable { public static void main(String args[]) throws Throwable {
new TestNoRTMLockElidingOption().test(); new TestNoRTMLockElidingOption().runTestCases();
} }
} }

View file

@ -30,6 +30,7 @@
* @library /test/lib / * @library /test/lib /
* @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.misc
* java.management * java.management
* @requires vm.flavor == "server" & !vm.emulatedClient & vm.rtm.cpu & vm.rtm.os
* @build sun.hotspot.WhiteBox * @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission * sun.hotspot.WhiteBox$WhiteBoxPermission
@ -44,13 +45,9 @@ import compiler.testlibrary.rtm.AbortProvoker;
import compiler.testlibrary.rtm.AbortType; import compiler.testlibrary.rtm.AbortType;
import compiler.testlibrary.rtm.RTMLockingStatistics; import compiler.testlibrary.rtm.RTMLockingStatistics;
import compiler.testlibrary.rtm.RTMTestBase; import compiler.testlibrary.rtm.RTMTestBase;
import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.test.lib.Asserts; import jdk.test.lib.Asserts;
import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.CommandLineOptionTest;
import jdk.test.lib.cli.predicate.AndPredicate;
import java.util.List; import java.util.List;
@ -66,12 +63,8 @@ import java.util.List;
* to avoid issue with retriable aborts described in * to avoid issue with retriable aborts described in
* {@link TestUseRTMAfterLockInflation}. * {@link TestUseRTMAfterLockInflation}.
*/ */
public class TestUseRTMLockElidingOption extends CommandLineOptionTest { public class TestUseRTMLockElidingOption {
private TestUseRTMLockElidingOption() {
super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM()));
}
@Override
public void runTestCases() throws Throwable { public void runTestCases() throws Throwable {
verifyOption(false); verifyOption(false);
verifyOption(true); verifyOption(true);
@ -122,6 +115,6 @@ public class TestUseRTMLockElidingOption extends CommandLineOptionTest {
} }
public static void main(String args[]) throws Throwable { public static void main(String args[]) throws Throwable {
new TestUseRTMLockElidingOption().test(); new TestUseRTMLockElidingOption().runTestCases();
} }
} }

View file

@ -31,6 +31,7 @@
* @library /test/lib / * @library /test/lib /
* @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.misc
* java.management * java.management
* @requires vm.flavor == "server" & !vm.emulatedClient & vm.rtm.cpu & vm.rtm.os
* @build sun.hotspot.WhiteBox * @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission * sun.hotspot.WhiteBox$WhiteBoxPermission
@ -46,13 +47,8 @@ import compiler.testlibrary.rtm.AbortProvoker;
import compiler.testlibrary.rtm.AbortType; import compiler.testlibrary.rtm.AbortType;
import compiler.testlibrary.rtm.RTMLockingStatistics; import compiler.testlibrary.rtm.RTMLockingStatistics;
import compiler.testlibrary.rtm.RTMTestBase; import compiler.testlibrary.rtm.RTMTestBase;
import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.test.lib.Asserts; import jdk.test.lib.Asserts;
import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.cli.CommandLineOptionTest;
import jdk.test.lib.cli.predicate.AndPredicate;
import java.util.Collections; import java.util.Collections;
import java.util.LinkedList; import java.util.LinkedList;
@ -64,13 +60,8 @@ import java.util.List;
* -XX:+PrintPreciseRTMLockingStatistics locking statistics contains sane * -XX:+PrintPreciseRTMLockingStatistics locking statistics contains sane
* total locks and aborts count as well as for specific abort types. * total locks and aborts count as well as for specific abort types.
*/ */
public class TestPrintPreciseRTMLockingStatistics public class TestPrintPreciseRTMLockingStatistics {
extends CommandLineOptionTest {
private TestPrintPreciseRTMLockingStatistics() {
super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM()));
}
@Override
public void runTestCases() throws Throwable { public void runTestCases() throws Throwable {
verifyNoStatistics(); verifyNoStatistics();
verifyStatistics(); verifyStatistics();
@ -147,6 +138,6 @@ public class TestPrintPreciseRTMLockingStatistics
} }
public static void main(String args[]) throws Throwable { public static void main(String args[]) throws Throwable {
new TestPrintPreciseRTMLockingStatistics().test(); new TestPrintPreciseRTMLockingStatistics().runTestCases();
} }
} }

View file

@ -1,37 +0,0 @@
/*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package compiler.testlibrary.rtm.predicate;
import jdk.test.lib.Platform;
import sun.hotspot.cpuinfo.CPUInfo;
import java.util.function.BooleanSupplier;
public class SupportedCPU implements BooleanSupplier {
@Override
public boolean getAsBoolean() {
if (Platform.isPPC()) { return CPUInfo.hasFeature("tcheck"); }
return CPUInfo.hasFeature("rtm");
}
}

View file

@ -1,48 +0,0 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package compiler.testlibrary.rtm.predicate;
import jdk.test.lib.Platform;
import java.util.function.BooleanSupplier;
public class SupportedOS implements BooleanSupplier {
@Override
public boolean getAsBoolean() {
if (Platform.isAix()) {
// Actually, this works since AIX 7.1.3.30, but os.version property
// is set to 7.1.
return (Platform.getOsVersionMajor() > 7) ||
(Platform.getOsVersionMajor() == 7 && Platform.getOsVersionMinor() > 1);
} else if (Platform.isLinux()) {
if (Platform.isPPC()) {
return (Platform.getOsVersionMajor() > 4) ||
(Platform.getOsVersionMajor() == 4 && Platform.getOsVersionMinor() > 1);
}
}
return true;
}
}

View file

@ -1,35 +0,0 @@
/*
* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package compiler.testlibrary.rtm.predicate;
import jdk.test.lib.Platform;
import java.util.function.BooleanSupplier;
public class SupportedVM implements BooleanSupplier {
@Override
public boolean getAsBoolean() {
return Platform.isServer() && !Platform.isEmulatedClient();
}
}