< prev index next >

src/hotspot/share/cds/cdsConfig.cpp

Print this page

 135       // It's easier to form the path using JAVA_HOME as os::jvm_path
 136       // gives the path to the launcher executable on static JDK.
 137       const char* subdir = WINDOWS_ONLY("bin") NOT_WINDOWS("lib");
 138       tmp.print("%s%s%s%s%s%sclasses",
 139                 Arguments::get_java_home(), os::file_separator(),
 140                 subdir, os::file_separator(),
 141                 Abstract_VM_Version::vm_variant(), os::file_separator());
 142     } else {
 143       // Assume .jsa is in the same directory where libjvm resides on
 144       // non-static JDK.
 145       char jvm_path[JVM_MAXPATHLEN];
 146       os::jvm_path(jvm_path, sizeof(jvm_path));
 147       char *end = strrchr(jvm_path, *os::file_separator());
 148       if (end != nullptr) *end = '\0';
 149       tmp.print("%s%sclasses", jvm_path, os::file_separator());
 150     }
 151 #ifdef _LP64
 152     if (!UseCompressedOops) {
 153       tmp.print_raw("_nocoops");
 154     }
 155     if (!UseCompactObjectHeaders) {
 156       // Note that generation of xxx_nocoh.jsa variants require
 157       // --enable-cds-archive-nocoh at build time
 158       tmp.print_raw("_nocoh");
 159     }
 160 #endif
 161     tmp.print_raw(".jsa");
 162     _default_archive_path = os::strdup(tmp.base());
 163   }
 164   return _default_archive_path;
 165 }
 166 
 167 int CDSConfig::num_archive_paths(const char* path_spec) {
 168   if (path_spec == nullptr) {
 169     return 0;
 170   }
 171   int npaths = 1;
 172   char* p = (char*)path_spec;
 173   while (*p != '\0') {
 174     if (*p == os::path_separator()[0]) {
 175       npaths++;
 176     }
 177     p++;
 178   }

 135       // It's easier to form the path using JAVA_HOME as os::jvm_path
 136       // gives the path to the launcher executable on static JDK.
 137       const char* subdir = WINDOWS_ONLY("bin") NOT_WINDOWS("lib");
 138       tmp.print("%s%s%s%s%s%sclasses",
 139                 Arguments::get_java_home(), os::file_separator(),
 140                 subdir, os::file_separator(),
 141                 Abstract_VM_Version::vm_variant(), os::file_separator());
 142     } else {
 143       // Assume .jsa is in the same directory where libjvm resides on
 144       // non-static JDK.
 145       char jvm_path[JVM_MAXPATHLEN];
 146       os::jvm_path(jvm_path, sizeof(jvm_path));
 147       char *end = strrchr(jvm_path, *os::file_separator());
 148       if (end != nullptr) *end = '\0';
 149       tmp.print("%s%sclasses", jvm_path, os::file_separator());
 150     }
 151 #ifdef _LP64
 152     if (!UseCompressedOops) {
 153       tmp.print_raw("_nocoops");
 154     }
 155     if (UseCompactObjectHeaders) {
 156       // Note that generation of xxx_coh.jsa variants require
 157       // --enable-cds-archive-coh at build time
 158       tmp.print_raw("_coh");
 159     }
 160 #endif
 161     tmp.print_raw(".jsa");
 162     _default_archive_path = os::strdup(tmp.base());
 163   }
 164   return _default_archive_path;
 165 }
 166 
 167 int CDSConfig::num_archive_paths(const char* path_spec) {
 168   if (path_spec == nullptr) {
 169     return 0;
 170   }
 171   int npaths = 1;
 172   char* p = (char*)path_spec;
 173   while (*p != '\0') {
 174     if (*p == os::path_separator()[0]) {
 175       npaths++;
 176     }
 177     p++;
 178   }
< prev index next >