--- old/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsUtils.java 2018-10-29 14:02:59.421778612 -0700 +++ new/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsUtils.java 2018-10-29 14:02:59.057764208 -0700 @@ -30,6 +30,11 @@ public static final String TEST_JAR_NAME = "test"; public static final String TEST_JAR_NAME_FULL = "test.jar"; public static final String WHITEBOX_JAR_NAME = "whitebox"; + private static String vmOptionsPrefix[] = {}; + + static void setVMOptionsPrefix(String[] opts) { + vmOptionsPrefix = opts; + } public static String getWbParam() { return "-Xbootclasspath/a:" + TestCommon.getTestJar(WHITEBOX_JAR_NAME + ".jar"); @@ -55,6 +60,7 @@ TestCommon.concat(extraOptions, "-XX:+UseCompressedOops", "-XX:+UseG1GC", "-XX:SharedArchiveConfigFile=" + TestCommon.getSourceFile(sharedDataFile)); + args = TestCommon.concat(vmOptionsPrefix, args); return TestCommon.dump(appJar, appClasses, args); } @@ -80,6 +86,7 @@ String appJar = TestCommon.getTestJar(TEST_JAR_NAME_FULL); String[] args = TestCommon.concat(extraOptions, "-cp", appJar, "-XX:+UseCompressedOops", "-XX:+UseG1GC", className); + args = TestCommon.concat(vmOptionsPrefix, args); OutputAnalyzer output = TestCommon.execAuto(args); checkExecAuto(output); @@ -98,6 +105,7 @@ String appJar = TestCommon.getTestJar(TEST_JAR_NAME_FULL); String[] args = TestCommon.concat(extraOptions, "-XX:+UseCompressedOops", "-XX:+UseG1GC", className); + args = TestCommon.concat(vmOptionsPrefix, args); OutputAnalyzer output = TestCommon.exec(appJar, args); checkExec(output, extraMatches);