8173679: Disable ProfileTrap code and UseRTMLocking in emulated client Win32
authorjcm
Fri, 03 Feb 2017 19:26:48 -0800
changeset 43921 d956a2151cba
parent 43658 4abbeb6d852d
child 43922 3a723d6b2734
child 43923 5baba098c4bd
8173679: Disable ProfileTrap code and UseRTMLocking in emulated client Win32 Summary: Made emulatedVM related changes in cli verfiy*SameVM. Reviewed-by: kvn
test/lib/jdk/test/lib/cli/CommandLineOptionTest.java
--- a/test/lib/jdk/test/lib/cli/CommandLineOptionTest.java	Thu Feb 02 05:26:46 2017 -0800
+++ b/test/lib/jdk/test/lib/cli/CommandLineOptionTest.java	Fri Feb 03 19:26:48 2017 -0800
@@ -199,6 +199,10 @@
             throws Throwable {
         List<String> finalOptions = new ArrayList<>();
         finalOptions.add(CommandLineOptionTest.getVMTypeOption());
+        String extraFlagForEmulated = CommandLineOptionTest.getVMTypeOptionForEmulated();
+        if (extraFlagForEmulated != null) {
+            finalOptions.add(extraFlagForEmulated);
+        }
         Collections.addAll(finalOptions, options);
 
         CommandLineOptionTest.verifyJVMStartup(expectedMessages,
@@ -390,6 +394,10 @@
             String... additionalVMOpts) throws Throwable {
         List<String> finalOptions = new ArrayList<>();
         finalOptions.add(CommandLineOptionTest.getVMTypeOption());
+        String extraFlagForEmulated = CommandLineOptionTest.getVMTypeOptionForEmulated();
+        if (extraFlagForEmulated != null) {
+            finalOptions.add(extraFlagForEmulated);
+        }
         Collections.addAll(finalOptions, additionalVMOpts);
 
         CommandLineOptionTest.verifyOptionValue(optionName, expectedValue,
@@ -497,6 +505,18 @@
         throw new RuntimeException("Unknown VM mode.");
     }
 
+    /**
+     * @return addtional VMoptions(Emulated related) required to start a new VM with the same type as current.
+     */
+    private static String getVMTypeOptionForEmulated() {
+        if (Platform.isServer() && !Platform.isEmulatedClient()) {
+            return "-XX:-NeverActAsServerClassMachine";
+        } else if (Platform.isEmulatedClient()) {
+            return "-XX:+NeverActAsServerClassMachine";
+        }
+        return null;
+    }
+
     private final BooleanSupplier predicate;
 
     /**