8165235: [TESTBUG] RTM tests must check OS version
authorgoetz
Thu, 01 Sep 2016 16:47:53 +0200
changeset 41321 463ff7705f2f
parent 41320 01ba89ffe494
child 41322 d91c045cdfe4
child 41323 ddd5600d4762
8165235: [TESTBUG] RTM tests must check OS version Summary: Also change enabling RTM on Aix to OS version 7.2. Reviewed-by: simonis, fzhinkin
hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp
hotspot/test/compiler/rtm/cli/RTMLockingAwareTest.java
hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig.java
hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig.java
hotspot/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnUnsupportedConfig.java
hotspot/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnUnsupportedConfig.java
hotspot/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java
hotspot/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnUnsupportedConfig.java
hotspot/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnSupportedConfig.java
hotspot/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnUnsupportedConfig.java
hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java
hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java
hotspot/test/compiler/rtm/locking/TestRTMAbortRatio.java
hotspot/test/compiler/rtm/locking/TestRTMAbortThreshold.java
hotspot/test/compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java
hotspot/test/compiler/rtm/locking/TestRTMDeoptOnHighAbortRatio.java
hotspot/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java
hotspot/test/compiler/rtm/locking/TestRTMLockingCalculationDelay.java
hotspot/test/compiler/rtm/locking/TestRTMLockingThreshold.java
hotspot/test/compiler/rtm/locking/TestRTMRetryCount.java
hotspot/test/compiler/rtm/locking/TestRTMSpinLoopCount.java
hotspot/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java
hotspot/test/compiler/rtm/locking/TestUseRTMAfterLockInflation.java
hotspot/test/compiler/rtm/locking/TestUseRTMDeopt.java
hotspot/test/compiler/rtm/locking/TestUseRTMForInflatedLocks.java
hotspot/test/compiler/rtm/locking/TestUseRTMForStackLocks.java
hotspot/test/compiler/rtm/locking/TestUseRTMXendForLockBusy.java
hotspot/test/compiler/rtm/method_options/TestNoRTMLockElidingOption.java
hotspot/test/compiler/rtm/method_options/TestUseRTMLockElidingOption.java
hotspot/test/compiler/rtm/print/TestPrintPreciseRTMLockingStatistics.java
hotspot/test/compiler/testlibrary/rtm/predicate/SupportedOS.java
--- a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp	Thu Sep 08 18:17:50 2016 -0400
+++ b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp	Thu Sep 01 16:47:53 2016 +0200
@@ -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
--- a/hotspot/test/compiler/rtm/cli/RTMLockingAwareTest.java	Thu Sep 08 18:17:50 2016 -0400
+++ b/hotspot/test/compiler/rtm/cli/RTMLockingAwareTest.java	Thu Sep 01 16:47:53 2016 +0200
@@ -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;
--- a/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig.java	Thu Sep 08 18:17:50 2016 -0400
+++ b/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig.java	Thu Sep 01 16:47:53 2016 +0200
@@ -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
--- a/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig.java	Thu Sep 08 18:17:50 2016 -0400
+++ b/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig.java	Thu Sep 01 16:47:53 2016 +0200
@@ -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 {
--- a/hotspot/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnUnsupportedConfig.java	Thu Sep 08 18:17:50 2016 -0400
+++ b/hotspot/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnUnsupportedConfig.java	Thu Sep 01 16:47:53 2016 +0200
@@ -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");
--- a/hotspot/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnUnsupportedConfig.java	Thu Sep 08 18:17:50 2016 -0400
+++ b/hotspot/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnUnsupportedConfig.java	Thu Sep 01 16:47:53 2016 +0200
@@ -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,
--- a/hotspot/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java	Thu Sep 08 18:17:50 2016 -0400
+++ b/hotspot/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java	Thu Sep 01 16:47:53 2016 +0200
@@ -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
--- a/hotspot/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnUnsupportedConfig.java	Thu Sep 08 18:17:50 2016 -0400
+++ b/hotspot/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnUnsupportedConfig.java	Thu Sep 01 16:47:53 2016 +0200
@@ -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");
--- a/hotspot/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnSupportedConfig.java	Thu Sep 08 18:17:50 2016 -0400
+++ b/hotspot/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnSupportedConfig.java	Thu Sep 01 16:47:53 2016 +0200
@@ -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
--- a/hotspot/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnUnsupportedConfig.java	Thu Sep 08 18:17:50 2016 -0400
+++ b/hotspot/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnUnsupportedConfig.java	Thu Sep 01 16:47:53 2016 +0200
@@ -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");
--- a/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java	Thu Sep 08 18:17:50 2016 -0400
+++ b/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java	Thu Sep 01 16:47:53 2016 +0200
@@ -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
--- a/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java	Thu Sep 08 18:17:50 2016 -0400
+++ b/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java	Thu Sep 01 16:47:53 2016 +0200
@@ -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
--- a/hotspot/test/compiler/rtm/locking/TestRTMAbortRatio.java	Thu Sep 08 18:17:50 2016 -0400
+++ b/hotspot/test/compiler/rtm/locking/TestRTMAbortRatio.java	Thu Sep 01 16:47:53 2016 +0200
@@ -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
--- a/hotspot/test/compiler/rtm/locking/TestRTMAbortThreshold.java	Thu Sep 08 18:17:50 2016 -0400
+++ b/hotspot/test/compiler/rtm/locking/TestRTMAbortThreshold.java	Thu Sep 01 16:47:53 2016 +0200
@@ -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
--- a/hotspot/test/compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java	Thu Sep 08 18:17:50 2016 -0400
+++ b/hotspot/test/compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java	Thu Sep 01 16:47:53 2016 +0200
@@ -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
--- a/hotspot/test/compiler/rtm/locking/TestRTMDeoptOnHighAbortRatio.java	Thu Sep 08 18:17:50 2016 -0400
+++ b/hotspot/test/compiler/rtm/locking/TestRTMDeoptOnHighAbortRatio.java	Thu Sep 01 16:47:53 2016 +0200
@@ -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
--- a/hotspot/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java	Thu Sep 08 18:17:50 2016 -0400
+++ b/hotspot/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java	Thu Sep 01 16:47:53 2016 +0200
@@ -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
--- a/hotspot/test/compiler/rtm/locking/TestRTMLockingCalculationDelay.java	Thu Sep 08 18:17:50 2016 -0400
+++ b/hotspot/test/compiler/rtm/locking/TestRTMLockingCalculationDelay.java	Thu Sep 01 16:47:53 2016 +0200
@@ -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
--- a/hotspot/test/compiler/rtm/locking/TestRTMLockingThreshold.java	Thu Sep 08 18:17:50 2016 -0400
+++ b/hotspot/test/compiler/rtm/locking/TestRTMLockingThreshold.java	Thu Sep 01 16:47:53 2016 +0200
@@ -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()));
     }
 
     /**
--- a/hotspot/test/compiler/rtm/locking/TestRTMRetryCount.java	Thu Sep 08 18:17:50 2016 -0400
+++ b/hotspot/test/compiler/rtm/locking/TestRTMRetryCount.java	Thu Sep 01 16:47:53 2016 +0200
@@ -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
--- a/hotspot/test/compiler/rtm/locking/TestRTMSpinLoopCount.java	Thu Sep 08 18:17:50 2016 -0400
+++ b/hotspot/test/compiler/rtm/locking/TestRTMSpinLoopCount.java	Thu Sep 01 16:47:53 2016 +0200
@@ -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
--- a/hotspot/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java	Thu Sep 08 18:17:50 2016 -0400
+++ b/hotspot/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java	Thu Sep 01 16:47:53 2016 +0200
@@ -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
--- a/hotspot/test/compiler/rtm/locking/TestUseRTMAfterLockInflation.java	Thu Sep 08 18:17:50 2016 -0400
+++ b/hotspot/test/compiler/rtm/locking/TestUseRTMAfterLockInflation.java	Thu Sep 01 16:47:53 2016 +0200
@@ -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
--- a/hotspot/test/compiler/rtm/locking/TestUseRTMDeopt.java	Thu Sep 08 18:17:50 2016 -0400
+++ b/hotspot/test/compiler/rtm/locking/TestUseRTMDeopt.java	Thu Sep 01 16:47:53 2016 +0200
@@ -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
--- a/hotspot/test/compiler/rtm/locking/TestUseRTMForInflatedLocks.java	Thu Sep 08 18:17:50 2016 -0400
+++ b/hotspot/test/compiler/rtm/locking/TestUseRTMForInflatedLocks.java	Thu Sep 01 16:47:53 2016 +0200
@@ -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
--- a/hotspot/test/compiler/rtm/locking/TestUseRTMForStackLocks.java	Thu Sep 08 18:17:50 2016 -0400
+++ b/hotspot/test/compiler/rtm/locking/TestUseRTMForStackLocks.java	Thu Sep 01 16:47:53 2016 +0200
@@ -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
--- a/hotspot/test/compiler/rtm/locking/TestUseRTMXendForLockBusy.java	Thu Sep 08 18:17:50 2016 -0400
+++ b/hotspot/test/compiler/rtm/locking/TestUseRTMXendForLockBusy.java	Thu Sep 01 16:47:53 2016 +0200
@@ -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
--- a/hotspot/test/compiler/rtm/method_options/TestNoRTMLockElidingOption.java	Thu Sep 08 18:17:50 2016 -0400
+++ b/hotspot/test/compiler/rtm/method_options/TestNoRTMLockElidingOption.java	Thu Sep 01 16:47:53 2016 +0200
@@ -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
--- a/hotspot/test/compiler/rtm/method_options/TestUseRTMLockElidingOption.java	Thu Sep 08 18:17:50 2016 -0400
+++ b/hotspot/test/compiler/rtm/method_options/TestUseRTMLockElidingOption.java	Thu Sep 01 16:47:53 2016 +0200
@@ -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
--- a/hotspot/test/compiler/rtm/print/TestPrintPreciseRTMLockingStatistics.java	Thu Sep 08 18:17:50 2016 -0400
+++ b/hotspot/test/compiler/rtm/print/TestPrintPreciseRTMLockingStatistics.java	Thu Sep 01 16:47:53 2016 +0200
@@ -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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/testlibrary/rtm/predicate/SupportedOS.java	Thu Sep 01 16:47:53 2016 +0200
@@ -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;
+    }
+}