< prev index next >

test/compiler/testlibrary/rtm/RTMTestBase.java

Print this page
rev 11918 : 8164987: RTM jtreg tests failing due to unnamed module unable to access class jdk.internal.misc.Unsafe


 224      */
 225     private static String[] prepareFilteredTestOptions(CompilableTest test,
 226             String[] additionalFilters, String... vmOpts) {
 227         List<String> finalVMOpts = new LinkedList<>();
 228         String[] filters;
 229 
 230         if (additionalFilters != null) {
 231             filters = Arrays.copyOf(additionalFilters,
 232                     additionalFilters.length + 1);
 233         } else {
 234             filters = new String[1];
 235         }
 236 
 237         filters[filters.length - 1] = "RTM";
 238         String[] filteredVMOpts = Utils.getFilteredTestJavaOpts(filters);
 239         Collections.addAll(finalVMOpts, filteredVMOpts);
 240         Collections.addAll(finalVMOpts, "-Xcomp", "-server",
 241                 "-XX:-TieredCompilation", "-XX:+UseRTMLocking",
 242                 CommandLineOptionTest.UNLOCK_DIAGNOSTIC_VM_OPTIONS,
 243                 CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
 244                 "-Xbootclasspath/a:.", "-XX:+WhiteBoxAPI");

 245 
 246         if (test != null) {
 247             for (String method : test.getMethodsToCompileNames()) {
 248                 finalVMOpts.add("-XX:CompileCommand=compileonly," + method);
 249             }
 250         }
 251         Collections.addAll(finalVMOpts, vmOpts);
 252         return finalVMOpts.toArray(new String[finalVMOpts.size()]);
 253     }
 254 
 255     /**
 256      * Adds additional options for VM required for successful execution of test.
 257      *
 258      * @param logFileName a name of compilation log file
 259      * @param test a test case to execute
 260      * @param options additional options to VM
 261      * @return an array with VM options
 262      */
 263     private static String[] prepareTestOptions(String logFileName,
 264             CompilableTest test, String... options) {


 224      */
 225     private static String[] prepareFilteredTestOptions(CompilableTest test,
 226             String[] additionalFilters, String... vmOpts) {
 227         List<String> finalVMOpts = new LinkedList<>();
 228         String[] filters;
 229 
 230         if (additionalFilters != null) {
 231             filters = Arrays.copyOf(additionalFilters,
 232                     additionalFilters.length + 1);
 233         } else {
 234             filters = new String[1];
 235         }
 236 
 237         filters[filters.length - 1] = "RTM";
 238         String[] filteredVMOpts = Utils.getFilteredTestJavaOpts(filters);
 239         Collections.addAll(finalVMOpts, filteredVMOpts);
 240         Collections.addAll(finalVMOpts, "-Xcomp", "-server",
 241                 "-XX:-TieredCompilation", "-XX:+UseRTMLocking",
 242                 CommandLineOptionTest.UNLOCK_DIAGNOSTIC_VM_OPTIONS,
 243                 CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
 244                 "-Xbootclasspath/a:.", "-XX:+WhiteBoxAPI",
 245                 "-XaddExports:java.base/jdk.internal.misc=ALL-UNNAMED");
 246 
 247         if (test != null) {
 248             for (String method : test.getMethodsToCompileNames()) {
 249                 finalVMOpts.add("-XX:CompileCommand=compileonly," + method);
 250             }
 251         }
 252         Collections.addAll(finalVMOpts, vmOpts);
 253         return finalVMOpts.toArray(new String[finalVMOpts.size()]);
 254     }
 255 
 256     /**
 257      * Adds additional options for VM required for successful execution of test.
 258      *
 259      * @param logFileName a name of compilation log file
 260      * @param test a test case to execute
 261      * @param options additional options to VM
 262      * @return an array with VM options
 263      */
 264     private static String[] prepareTestOptions(String logFileName,
 265             CompilableTest test, String... options) {
< prev index next >