8204591: Expire/remove the UseAppCDS option in JDK 12
authorccheung
Tue, 17 Jul 2018 11:58:53 -0700
changeset 51104 e34379f2a1c8
parent 51103 cecc2e10edf4
child 51105 c6600aba799b
8204591: Expire/remove the UseAppCDS option in JDK 12 Reviewed-by: jiangli, mseledtsov, iklam
src/hotspot/share/runtime/arguments.cpp
test/hotspot/jtreg/runtime/appcds/CommandLineFlagComboNegative.java
test/hotspot/jtreg/runtime/appcds/MismatchedUseAppCDS.java
test/hotspot/jtreg/runtime/appcds/test-classes/CheckIfShared.java
--- a/src/hotspot/share/runtime/arguments.cpp	Tue Jul 17 14:28:56 2018 +0200
+++ b/src/hotspot/share/runtime/arguments.cpp	Tue Jul 17 11:58:53 2018 -0700
@@ -561,7 +561,6 @@
   { "SharedMiscDataSize",            JDK_Version::undefined(), JDK_Version::jdk(10), JDK_Version::undefined() },
   { "SharedMiscCodeSize",            JDK_Version::undefined(), JDK_Version::jdk(10), JDK_Version::undefined() },
   { "UseUTCFileTimestamp",           JDK_Version::undefined(), JDK_Version::jdk(11), JDK_Version::jdk(12) },
-  { "UseAppCDS",                     JDK_Version::undefined(), JDK_Version::jdk(11), JDK_Version::jdk(12) },
   { "InlineNotify",                  JDK_Version::undefined(), JDK_Version::jdk(11), JDK_Version::jdk(12) },
   { "EnableTracing",                 JDK_Version::undefined(), JDK_Version::jdk(11), JDK_Version::jdk(12) },
   { "UseLockedTracing",              JDK_Version::undefined(), JDK_Version::jdk(11), JDK_Version::jdk(12) },
@@ -1274,13 +1273,9 @@
     char stripped_argname[BUFLEN+1]; // +1 for '\0'
     jio_snprintf(stripped_argname, arg_len+1, "%s", argname); // +1 for '\0'
     if (is_obsolete_flag(stripped_argname, &since)) {
-      if (strcmp(stripped_argname, "UseAppCDS") != 0) {
-        char version[256];
-        since.to_string(version, sizeof(version));
-        warning("Ignoring option %s; support was removed in %s", stripped_argname, version);
-      } else {
-        warning("Ignoring obsolete option UseAppCDS; AppCDS is automatically enabled");
-      }
+      char version[256];
+      since.to_string(version, sizeof(version));
+      warning("Ignoring option %s; support was removed in %s", stripped_argname, version);
       return true;
     }
 #ifndef PRODUCT
--- a/test/hotspot/jtreg/runtime/appcds/CommandLineFlagComboNegative.java	Tue Jul 17 14:28:56 2018 +0200
+++ b/test/hotspot/jtreg/runtime/appcds/CommandLineFlagComboNegative.java	Tue Jul 17 11:58:53 2018 -0700
@@ -71,8 +71,6 @@
                 "Class data sharing is inconsistent with other specified options", 1) );
             testTable.add( new TestVector("-XX:+UseCompressedClassPointers", "-XX:-UseCompressedClassPointers",
                 "Class data sharing is inconsistent with other specified options", 1) );
-            testTable.add( new TestVector("-XX:-UseAppCDS", "-XX:+UseAppCDS",
-                "Ignoring obsolete option UseAppCDS; AppCDS is automatically enabled", 0) );
         }
     }
 
--- a/test/hotspot/jtreg/runtime/appcds/MismatchedUseAppCDS.java	Tue Jul 17 14:28:56 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 2015, 2018, 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.
- *
- */
-
-/*
- * @test
- * @summary Try different combination of mismatched UseAppCDS between dump time and run time.
- * @requires vm.cds
- * @library /test/lib
- * @modules java.base/jdk.internal.misc
- *          java.management
- *          jdk.jartool/sun.tools.jar
- * @compile test-classes/CheckIfShared.java
- * @build sun.hotspot.WhiteBox
- * @run driver ClassFileInstaller sun.hotspot.WhiteBox
- * @run main MismatchedUseAppCDS
- */
-
-import jdk.test.lib.process.OutputAnalyzer;
-
-public class MismatchedUseAppCDS {
-  public static void main(String[] args) throws Exception {
-    String wbJar = JarBuilder.build(true, "WhiteBox", "sun/hotspot/WhiteBox");
-    String use_whitebox_jar = "-Xbootclasspath/a:" + wbJar;
-
-    String appJar = JarBuilder.build("MismatchedUseAppCDS", "CheckIfShared");
-
-    OutputAnalyzer output;
-
-    // (1): dump with -XX:+UseAppCDS, but run with -XX:-UseAppCDS
-    TestCommon.testDump(appJar, TestCommon.list("CheckIfShared"),
-                        // command-line arguments ...
-                        "-XX:+UseAppCDS",
-                        use_whitebox_jar);
-
-    output = TestCommon.exec(appJar,
-                             // command-line arguments ...
-                             use_whitebox_jar,
-                             "-XX:-UseAppCDS",
-                             "-XX:+UnlockDiagnosticVMOptions",
-                             "-XX:+WhiteBoxAPI",
-                             "CheckIfShared", "true");
-    TestCommon.checkExec(output);
-
-    // (2): dump with -XX:-UseAppCDS, but run with -XX:+UseAppCDS
-    TestCommon.testDump(appJar, TestCommon.list("CheckIfShared"),
-                        // command-line arguments ...
-                        "-XX:-UseAppCDS",
-                        use_whitebox_jar);
-
-    output = TestCommon.exec(appJar,
-                             // command-line arguments ...
-                             use_whitebox_jar,
-                             "-XX:+UseAppCDS",
-                             "-XX:+UnlockDiagnosticVMOptions",
-                             "-XX:+WhiteBoxAPI",
-                             "CheckIfShared", "true");
-    TestCommon.checkExec(output);
-  }
-}
--- a/test/hotspot/jtreg/runtime/appcds/test-classes/CheckIfShared.java	Tue Jul 17 14:28:56 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2015, 2017, 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.
- *
- */
-
-import sun.hotspot.WhiteBox;
-
-public class CheckIfShared {
-  public static void main(String args[]) throws Exception {
-    WhiteBox wb = WhiteBox.getWhiteBox();
-    if ("true".equals(args[0])) {
-      if (!wb.isSharedClass(CheckIfShared.class)) {
-        throw new RuntimeException("wb.isSharedClass(CheckIfShared.class) should be true");
-      }
-    } else {
-      if (wb.isSharedClass(CheckIfShared.class)) {
-        throw new RuntimeException("wb.isSharedClass(CheckIfShared.class) should be false");
-      }
-    }
-  }
-}