test/hotspot/jtreg/runtime/appcds/TestCommon.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File open Sdiff test/hotspot/jtreg/runtime/appcds

test/hotspot/jtreg/runtime/appcds/TestCommon.java

Print this page




 116 
 117     // Create AppCDS archive using appcds options
 118     public static OutputAnalyzer createArchive(AppCDSOptions opts)
 119         throws Exception {
 120 
 121         ArrayList<String> cmd = new ArrayList<String>();
 122         File classList = makeClassList(opts.appClasses);
 123         startNewArchiveName();
 124 
 125         for (String p : opts.prefix) cmd.add(p);
 126 
 127         if (opts.appJar != null) {
 128             cmd.add("-cp");
 129             cmd.add(opts.appJar);
 130         } else {
 131             cmd.add("-cp");
 132             cmd.add("\"\"");
 133         }
 134 
 135         cmd.add("-Xshare:dump");
 136         cmd.add("-Xlog:cds,cds+hashtables");
 137         cmd.add("-XX:ExtraSharedClassListFile=" + classList.getPath());
 138 
 139         if (opts.archiveName == null)
 140             opts.archiveName = getCurrentArchiveName();
 141 
 142         cmd.add("-XX:SharedArchiveFile=" + opts.archiveName);
 143 
 144         for (String s : opts.suffix) cmd.add(s);
 145 
 146         String[] cmdLine = cmd.toArray(new String[cmd.size()]);
 147         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, makeCommandLineForAppCDS(cmdLine));
 148         return executeAndLog(pb, "dump");
 149     }
 150 
 151 
 152     // Execute JVM using AppCDS archive with specified AppCDSOptions
 153     public static OutputAnalyzer runWithArchive(AppCDSOptions opts)
 154         throws Exception {
 155 
 156         ArrayList<String> cmd = new ArrayList<String>();




 116 
 117     // Create AppCDS archive using appcds options
 118     public static OutputAnalyzer createArchive(AppCDSOptions opts)
 119         throws Exception {
 120 
 121         ArrayList<String> cmd = new ArrayList<String>();
 122         File classList = makeClassList(opts.appClasses);
 123         startNewArchiveName();
 124 
 125         for (String p : opts.prefix) cmd.add(p);
 126 
 127         if (opts.appJar != null) {
 128             cmd.add("-cp");
 129             cmd.add(opts.appJar);
 130         } else {
 131             cmd.add("-cp");
 132             cmd.add("\"\"");
 133         }
 134 
 135         cmd.add("-Xshare:dump");

 136         cmd.add("-XX:ExtraSharedClassListFile=" + classList.getPath());
 137 
 138         if (opts.archiveName == null)
 139             opts.archiveName = getCurrentArchiveName();
 140 
 141         cmd.add("-XX:SharedArchiveFile=" + opts.archiveName);
 142 
 143         for (String s : opts.suffix) cmd.add(s);
 144 
 145         String[] cmdLine = cmd.toArray(new String[cmd.size()]);
 146         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, makeCommandLineForAppCDS(cmdLine));
 147         return executeAndLog(pb, "dump");
 148     }
 149 
 150 
 151     // Execute JVM using AppCDS archive with specified AppCDSOptions
 152     public static OutputAnalyzer runWithArchive(AppCDSOptions opts)
 153         throws Exception {
 154 
 155         ArrayList<String> cmd = new ArrayList<String>();


test/hotspot/jtreg/runtime/appcds/TestCommon.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File