# HG changeset patch # User goetz # Date 1472741273 -7200 # Node ID a6e83ad62437a123ccb888caefdfe1f2498d2446 # Parent 1b3cd490db61641254d66ceb05fe539181e8bc87 8165235: [TESTBUG] RTM tests must check OS version Summary: Also change enabling RTM on Aix to OS version 7.2. Reviewed-by: simonis diff --git a/src/cpu/ppc/vm/vm_version_ppc.cpp b/src/cpu/ppc/vm/vm_version_ppc.cpp --- a/src/cpu/ppc/vm/vm_version_ppc.cpp +++ b/src/cpu/ppc/vm/vm_version_ppc.cpp @@ -274,7 +274,14 @@ } bool os_too_old = true; #ifdef AIX - if (os::Aix::os_version() >= 0x0701031e) { // at least AIX 7.1.3.30 + // Actually, this is supported since AIX 7.1.. Unfortunately, this first + // contained bugs, so that it can only be enabled after AIX 7.1.3.30. + // The Java property os.version, which is used in RTM tests to decide + // whether the feature is available, only knows major and minor versions. + // We don't want to change this property, as user code might depend on it. + // So the tests can not check on subversion 3.30, and we only enable RTM + // with AIX 7.2. + if (os::Aix::os_version() >= 0x07020000) { // At least AIX 7.2. os_too_old = false; } #endif diff --git a/test/compiler/rtm/cli/RTMLockingAwareTest.java b/test/compiler/rtm/cli/RTMLockingAwareTest.java --- a/test/compiler/rtm/cli/RTMLockingAwareTest.java +++ b/test/compiler/rtm/cli/RTMLockingAwareTest.java @@ -25,6 +25,7 @@ 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.cli.CommandLineOptionTest; @@ -66,7 +67,7 @@ boolean isExperimental, String defaultValue, String[] correctValues, String[] incorrectValues, String warningMessage) { - super(new AndPredicate(new SupportedCPU(), new SupportedVM()), + super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM()), optionName, isBoolean, isExperimental, defaultValue); this.correctValues = correctValues; this.incorrectValues = incorrectValues; diff --git a/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig.java b/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig.java --- a/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig.java +++ b/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig.java @@ -42,6 +42,7 @@ 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.predicate.AndPredicate; @@ -49,7 +50,7 @@ public class TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig extends TestPrintPreciseRTMLockingStatisticsBase { private TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig() { - super(new AndPredicate(new SupportedVM(), new SupportedCPU())); + super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM())); } @Override diff --git a/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig.java b/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig.java --- a/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig.java +++ b/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig.java @@ -42,6 +42,7 @@ 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; @@ -49,8 +50,8 @@ public class TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig extends TestPrintPreciseRTMLockingStatisticsBase { private TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig() { - super(new NotPredicate(new AndPredicate(new SupportedCPU(), - new SupportedVM()))); + super(new NotPredicate( + new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM()))); } public static void main(String args[]) throws Throwable { diff --git a/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnUnsupportedConfig.java b/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnUnsupportedConfig.java --- a/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnUnsupportedConfig.java +++ b/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnUnsupportedConfig.java @@ -42,6 +42,7 @@ 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; @@ -51,8 +52,8 @@ private static final String DEFAULT_VALUE = "50"; private TestRTMAbortRatioOptionOnUnsupportedConfig() { - super(new NotPredicate(new AndPredicate(new SupportedVM(), - new SupportedCPU())), + super(new NotPredicate( + new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM())), "RTMAbortRatio", false, true, TestRTMAbortRatioOptionOnUnsupportedConfig.DEFAULT_VALUE, "0", "10", "100", "200"); diff --git a/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnUnsupportedConfig.java b/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnUnsupportedConfig.java --- a/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnUnsupportedConfig.java +++ b/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnUnsupportedConfig.java @@ -42,6 +42,7 @@ 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; @@ -51,8 +52,8 @@ private static final String DEFAULT_VALUE = "64"; private TestRTMTotalCountIncrRateOptionOnUnsupportedConfig() { - super(new NotPredicate(new AndPredicate(new SupportedCPU(), - new SupportedVM())), + super(new NotPredicate( + new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM())), "RTMTotalCountIncrRate", false, true, TestRTMTotalCountIncrRateOptionOnUnsupportedConfig .DEFAULT_VALUE, diff --git a/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java b/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java --- a/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java +++ b/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java @@ -42,6 +42,7 @@ 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.cli.CommandLineOptionTest; @@ -52,7 +53,7 @@ private static final String DEFAULT_VALUE = "false"; private TestUseRTMDeoptOptionOnSupportedConfig() { - super(new AndPredicate(new SupportedVM(), new SupportedCPU())); + super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM())); } @Override diff --git a/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnUnsupportedConfig.java b/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnUnsupportedConfig.java --- a/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnUnsupportedConfig.java +++ b/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnUnsupportedConfig.java @@ -42,6 +42,7 @@ 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.predicate.AndPredicate; @@ -52,8 +53,8 @@ private static final String DEFAULT_VALUE = "false"; private TestUseRTMDeoptOptionOnUnsupportedConfig() { - super(new NotPredicate(new AndPredicate(new SupportedCPU(), - new SupportedVM())), + super(new NotPredicate( + new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM())), "UseRTMDeopt", true, false, TestUseRTMDeoptOptionOnUnsupportedConfig.DEFAULT_VALUE, "true"); diff --git a/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnSupportedConfig.java b/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnSupportedConfig.java --- a/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnSupportedConfig.java +++ b/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnSupportedConfig.java @@ -42,6 +42,7 @@ 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.cli.CommandLineOptionTest; @@ -52,7 +53,7 @@ private static final String DEFAULT_VALUE = "false"; private TestUseRTMForStackLocksOptionOnSupportedConfig() { - super(new AndPredicate(new SupportedVM(), new SupportedCPU())); + super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM())); } @Override diff --git a/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnUnsupportedConfig.java b/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnUnsupportedConfig.java --- a/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnUnsupportedConfig.java +++ b/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnUnsupportedConfig.java @@ -42,6 +42,7 @@ 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.cli.CommandLineOptionTest; @@ -53,8 +54,8 @@ private static final String DEFAULT_VALUE = "false"; private TestUseRTMForStackLocksOptionOnUnsupportedConfig() { - super(new NotPredicate(new AndPredicate(new SupportedCPU(), - new SupportedVM())), + super(new NotPredicate( + new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM())), "UseRTMForStackLocks", true, true, TestUseRTMForStackLocksOptionOnUnsupportedConfig.DEFAULT_VALUE, "true"); diff --git a/test/compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java b/test/compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java --- a/test/compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java +++ b/test/compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java @@ -42,6 +42,7 @@ 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.cli.CommandLineOptionTest; @@ -52,7 +53,7 @@ private static final String DEFAULT_VALUE = "false"; private TestUseRTMLockingOptionOnSupportedConfig() { - super(new AndPredicate(new SupportedVM(), new SupportedCPU())); + super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM())); } @Override diff --git a/test/compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java b/test/compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java --- a/test/compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java +++ b/test/compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java @@ -42,6 +42,7 @@ 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.cli.CommandLineOptionTest; @@ -50,7 +51,7 @@ public class TestUseRTMLockingOptionWithBiasedLocking extends CommandLineOptionTest { private TestUseRTMLockingOptionWithBiasedLocking() { - super(new AndPredicate(new SupportedCPU(), new SupportedVM())); + super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM())); } @Override diff --git a/test/compiler/rtm/locking/TestRTMAbortRatio.java b/test/compiler/rtm/locking/TestRTMAbortRatio.java --- a/test/compiler/rtm/locking/TestRTMAbortRatio.java +++ b/test/compiler/rtm/locking/TestRTMAbortRatio.java @@ -45,6 +45,7 @@ import compiler.testlibrary.rtm.RTMLockingStatistics; 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.test.lib.Asserts; @@ -61,7 +62,7 @@ */ public class TestRTMAbortRatio extends CommandLineOptionTest { private TestRTMAbortRatio() { - super(new AndPredicate(new SupportedCPU(), new SupportedVM())); + super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM())); } @Override diff --git a/test/compiler/rtm/locking/TestRTMAbortThreshold.java b/test/compiler/rtm/locking/TestRTMAbortThreshold.java --- a/test/compiler/rtm/locking/TestRTMAbortThreshold.java +++ b/test/compiler/rtm/locking/TestRTMAbortThreshold.java @@ -45,6 +45,7 @@ import compiler.testlibrary.rtm.RTMLockingStatistics; 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.process.OutputAnalyzer; @@ -59,7 +60,7 @@ */ public class TestRTMAbortThreshold extends CommandLineOptionTest { private TestRTMAbortThreshold() { - super(new AndPredicate(new SupportedCPU(), new SupportedVM())); + super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM())); } @Override diff --git a/test/compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java b/test/compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java --- a/test/compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java +++ b/test/compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java @@ -47,6 +47,7 @@ import compiler.testlibrary.rtm.RTMLockingStatistics; 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.test.lib.Asserts; @@ -87,7 +88,7 @@ private static final String RANGE_CHECK = "range_check"; private TestRTMAfterNonRTMDeopt() { - super(new AndPredicate(new SupportedCPU(), new SupportedVM())); + super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM())); } @Override diff --git a/test/compiler/rtm/locking/TestRTMDeoptOnHighAbortRatio.java b/test/compiler/rtm/locking/TestRTMDeoptOnHighAbortRatio.java --- a/test/compiler/rtm/locking/TestRTMDeoptOnHighAbortRatio.java +++ b/test/compiler/rtm/locking/TestRTMDeoptOnHighAbortRatio.java @@ -45,6 +45,7 @@ import compiler.testlibrary.rtm.RTMLockingStatistics; 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.process.OutputAnalyzer; @@ -66,7 +67,7 @@ = AbortProvoker.DEFAULT_ITERATIONS / 2L; private TestRTMDeoptOnHighAbortRatio() { - super(new AndPredicate(new SupportedCPU(), new SupportedVM())); + super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM())); } @Override diff --git a/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java b/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java --- a/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java +++ b/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java @@ -44,6 +44,7 @@ import compiler.testlibrary.rtm.RTMLockingStatistics; 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.test.lib.Asserts; @@ -67,7 +68,7 @@ private static final long ABORT_THRESHOLD = LOCKING_THRESHOLD / 2L; private TestRTMDeoptOnLowAbortRatio() { - super(new AndPredicate(new SupportedCPU(), new SupportedVM())); + super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM())); } @Override diff --git a/test/compiler/rtm/locking/TestRTMLockingCalculationDelay.java b/test/compiler/rtm/locking/TestRTMLockingCalculationDelay.java --- a/test/compiler/rtm/locking/TestRTMLockingCalculationDelay.java +++ b/test/compiler/rtm/locking/TestRTMLockingCalculationDelay.java @@ -44,6 +44,7 @@ import compiler.testlibrary.rtm.AbortType; 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.process.OutputAnalyzer; @@ -58,7 +59,7 @@ private static final boolean INFLATE_MONITOR = true; private TestRTMLockingCalculationDelay() { - super(new AndPredicate(new SupportedCPU(), new SupportedVM())); + super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM())); } @Override diff --git a/test/compiler/rtm/locking/TestRTMLockingThreshold.java b/test/compiler/rtm/locking/TestRTMLockingThreshold.java --- a/test/compiler/rtm/locking/TestRTMLockingThreshold.java +++ b/test/compiler/rtm/locking/TestRTMLockingThreshold.java @@ -45,6 +45,7 @@ import compiler.testlibrary.rtm.RTMLockingStatistics; 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.test.lib.Asserts; @@ -61,7 +62,7 @@ */ public class TestRTMLockingThreshold extends CommandLineOptionTest { private TestRTMLockingThreshold() { - super(new AndPredicate(new SupportedVM(), new SupportedCPU())); + super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM())); } /** diff --git a/test/compiler/rtm/locking/TestRTMRetryCount.java b/test/compiler/rtm/locking/TestRTMRetryCount.java --- a/test/compiler/rtm/locking/TestRTMRetryCount.java +++ b/test/compiler/rtm/locking/TestRTMRetryCount.java @@ -44,6 +44,7 @@ import compiler.testlibrary.rtm.RTMLockingStatistics; 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.process.OutputAnalyzer; @@ -64,7 +65,7 @@ private static final boolean INFLATE_MONITOR = true; private TestRTMRetryCount() { - super(new AndPredicate(new SupportedCPU(), new SupportedVM())); + super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM())); } @Override diff --git a/test/compiler/rtm/locking/TestRTMSpinLoopCount.java b/test/compiler/rtm/locking/TestRTMSpinLoopCount.java --- a/test/compiler/rtm/locking/TestRTMSpinLoopCount.java +++ b/test/compiler/rtm/locking/TestRTMSpinLoopCount.java @@ -45,6 +45,7 @@ import compiler.testlibrary.rtm.RTMLockingStatistics; 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.process.OutputAnalyzer; @@ -66,7 +67,7 @@ = new int[] { 0, 100, 1_000, 1_000_000, 10_000_000 }; private TestRTMSpinLoopCount() { - super(new AndPredicate(new SupportedVM(), new SupportedCPU())); + super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM())); } @Override diff --git a/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java b/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java --- a/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java +++ b/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java @@ -45,6 +45,7 @@ import compiler.testlibrary.rtm.RTMLockingStatistics; 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.test.lib.Asserts; @@ -65,7 +66,7 @@ */ public class TestRTMTotalCountIncrRate extends CommandLineOptionTest { private TestRTMTotalCountIncrRate() { - super(new AndPredicate(new SupportedCPU(), new SupportedVM())); + super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM())); } @Override diff --git a/test/compiler/rtm/locking/TestUseRTMAfterLockInflation.java b/test/compiler/rtm/locking/TestUseRTMAfterLockInflation.java --- a/test/compiler/rtm/locking/TestUseRTMAfterLockInflation.java +++ b/test/compiler/rtm/locking/TestUseRTMAfterLockInflation.java @@ -45,6 +45,7 @@ import compiler.testlibrary.rtm.RTMLockingStatistics; 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.process.OutputAnalyzer; @@ -73,7 +74,7 @@ = 2L * AbortProvoker.DEFAULT_ITERATIONS; private TestUseRTMAfterLockInflation() { - super(new AndPredicate(new SupportedVM(), new SupportedCPU())); + super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM())); } @Override diff --git a/test/compiler/rtm/locking/TestUseRTMDeopt.java b/test/compiler/rtm/locking/TestUseRTMDeopt.java --- a/test/compiler/rtm/locking/TestUseRTMDeopt.java +++ b/test/compiler/rtm/locking/TestUseRTMDeopt.java @@ -44,6 +44,7 @@ import compiler.testlibrary.rtm.AbortType; 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.process.OutputAnalyzer; @@ -56,7 +57,7 @@ */ public class TestUseRTMDeopt extends CommandLineOptionTest { private TestUseRTMDeopt() { - super(new AndPredicate(new SupportedVM(), new SupportedCPU())); + super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM())); } @Override diff --git a/test/compiler/rtm/locking/TestUseRTMForInflatedLocks.java b/test/compiler/rtm/locking/TestUseRTMForInflatedLocks.java --- a/test/compiler/rtm/locking/TestUseRTMForInflatedLocks.java +++ b/test/compiler/rtm/locking/TestUseRTMForInflatedLocks.java @@ -43,6 +43,7 @@ import compiler.testlibrary.rtm.RTMLockingStatistics; 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.process.OutputAnalyzer; @@ -63,7 +64,7 @@ */ public class TestUseRTMForInflatedLocks extends CommandLineOptionTest { private TestUseRTMForInflatedLocks() { - super(new AndPredicate(new SupportedCPU(), new SupportedVM())); + super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM())); } @Override diff --git a/test/compiler/rtm/locking/TestUseRTMForStackLocks.java b/test/compiler/rtm/locking/TestUseRTMForStackLocks.java --- a/test/compiler/rtm/locking/TestUseRTMForStackLocks.java +++ b/test/compiler/rtm/locking/TestUseRTMForStackLocks.java @@ -44,6 +44,7 @@ import compiler.testlibrary.rtm.RTMLockingStatistics; 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.process.OutputAnalyzer; @@ -66,7 +67,7 @@ private static final boolean INFLATE_MONITOR = false; private TestUseRTMForStackLocks() { - super(new AndPredicate(new SupportedCPU(), new SupportedVM())); + super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM())); } @Override diff --git a/test/compiler/rtm/locking/TestUseRTMXendForLockBusy.java b/test/compiler/rtm/locking/TestUseRTMXendForLockBusy.java --- a/test/compiler/rtm/locking/TestUseRTMXendForLockBusy.java +++ b/test/compiler/rtm/locking/TestUseRTMXendForLockBusy.java @@ -46,6 +46,7 @@ import compiler.testlibrary.rtm.RTMLockingStatistics; 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.process.OutputAnalyzer; @@ -62,7 +63,7 @@ private final static int LOCKING_TIME = 5000; private TestUseRTMXendForLockBusy() { - super(new AndPredicate(new SupportedVM(), new SupportedCPU())); + super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM())); } @Override diff --git a/test/compiler/rtm/method_options/TestNoRTMLockElidingOption.java b/test/compiler/rtm/method_options/TestNoRTMLockElidingOption.java --- a/test/compiler/rtm/method_options/TestNoRTMLockElidingOption.java +++ b/test/compiler/rtm/method_options/TestNoRTMLockElidingOption.java @@ -45,6 +45,7 @@ import compiler.testlibrary.rtm.RTMLockingStatistics; 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.process.OutputAnalyzer; @@ -62,7 +63,7 @@ */ public class TestNoRTMLockElidingOption extends CommandLineOptionTest { private TestNoRTMLockElidingOption() { - super(new AndPredicate(new SupportedCPU(), new SupportedVM())); + super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM())); } @Override diff --git a/test/compiler/rtm/method_options/TestUseRTMLockElidingOption.java b/test/compiler/rtm/method_options/TestUseRTMLockElidingOption.java --- a/test/compiler/rtm/method_options/TestUseRTMLockElidingOption.java +++ b/test/compiler/rtm/method_options/TestUseRTMLockElidingOption.java @@ -46,6 +46,7 @@ import compiler.testlibrary.rtm.RTMLockingStatistics; 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.process.OutputAnalyzer; @@ -68,7 +69,7 @@ */ public class TestUseRTMLockElidingOption extends CommandLineOptionTest { private TestUseRTMLockElidingOption() { - super(new AndPredicate(new SupportedCPU(), new SupportedVM())); + super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM())); } @Override diff --git a/test/compiler/rtm/print/TestPrintPreciseRTMLockingStatistics.java b/test/compiler/rtm/print/TestPrintPreciseRTMLockingStatistics.java --- a/test/compiler/rtm/print/TestPrintPreciseRTMLockingStatistics.java +++ b/test/compiler/rtm/print/TestPrintPreciseRTMLockingStatistics.java @@ -48,6 +48,7 @@ import compiler.testlibrary.rtm.RTMLockingStatistics; 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.process.OutputAnalyzer; @@ -67,7 +68,7 @@ public class TestPrintPreciseRTMLockingStatistics extends CommandLineOptionTest { private TestPrintPreciseRTMLockingStatistics() { - super(new AndPredicate(new SupportedCPU(), new SupportedVM())); + super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM())); } @Override diff --git a/test/compiler/testlibrary/rtm/predicate/SupportedOS.java b/test/compiler/testlibrary/rtm/predicate/SupportedOS.java new file mode 100644 --- /dev/null +++ b/test/compiler/testlibrary/rtm/predicate/SupportedOS.java @@ -0,0 +1,48 @@ +/* + * 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; + } +}