< prev index next >

src/hotspot/share/cds/cdsConfig.cpp

Print this page

 65 
 66   // Initialize shared archive paths which could include both base and dynamic archive paths
 67   // This must be after set_ergonomics_flags() called so flag UseCompressedOops is set properly.
 68   //
 69   // UseSharedSpaces may be disabled if -XX:SharedArchiveFile is invalid.
 70   if (is_dumping_static_archive() || is_using_archive()) {
 71     init_shared_archive_paths();
 72   }
 73 
 74   if (!is_dumping_heap()) {
 75     _is_dumping_full_module_graph = false;
 76   }
 77 }
 78 
 79 char* CDSConfig::default_archive_path() {
 80   if (_default_archive_path == nullptr) {
 81     char jvm_path[JVM_MAXPATHLEN];
 82     os::jvm_path(jvm_path, sizeof(jvm_path));
 83     char *end = strrchr(jvm_path, *os::file_separator());
 84     if (end != nullptr) *end = '\0';
 85     size_t jvm_path_len = strlen(jvm_path);
 86     size_t file_sep_len = strlen(os::file_separator());
 87     const size_t len = jvm_path_len + file_sep_len + 20;
 88     _default_archive_path = NEW_C_HEAP_ARRAY(char, len, mtArguments);
 89     jio_snprintf(_default_archive_path, len,
 90                 LP64_ONLY(!UseCompressedOops ? "%s%sclasses_nocoops.jsa":) "%s%sclasses.jsa",
 91                 jvm_path, os::file_separator());







 92   }
 93   return _default_archive_path;
 94 }
 95 
 96 int CDSConfig::num_archives(const char* archive_path) {
 97   if (archive_path == nullptr) {
 98     return 0;
 99   }
100   int npaths = 1;
101   char* p = (char*)archive_path;
102   while (*p != '\0') {
103     if (*p == os::path_separator()[0]) {
104       npaths++;
105     }
106     p++;
107   }
108   return npaths;
109 }
110 
111 void CDSConfig::extract_shared_archive_paths(const char* archive_path,

 65 
 66   // Initialize shared archive paths which could include both base and dynamic archive paths
 67   // This must be after set_ergonomics_flags() called so flag UseCompressedOops is set properly.
 68   //
 69   // UseSharedSpaces may be disabled if -XX:SharedArchiveFile is invalid.
 70   if (is_dumping_static_archive() || is_using_archive()) {
 71     init_shared_archive_paths();
 72   }
 73 
 74   if (!is_dumping_heap()) {
 75     _is_dumping_full_module_graph = false;
 76   }
 77 }
 78 
 79 char* CDSConfig::default_archive_path() {
 80   if (_default_archive_path == nullptr) {
 81     char jvm_path[JVM_MAXPATHLEN];
 82     os::jvm_path(jvm_path, sizeof(jvm_path));
 83     char *end = strrchr(jvm_path, *os::file_separator());
 84     if (end != nullptr) *end = '\0';
 85     stringStream tmp;
 86     tmp.print("%s%sclasses", jvm_path, os::file_separator());
 87 #ifdef _LP64
 88     if (!UseCompressedOops) {
 89       tmp.print_raw("_nocoops");
 90     }
 91     if (UseCompactObjectHeaders) {
 92       // Note that generation of xxx_coh.jsa variants require
 93       // --enable-cds-archive-coh at build time
 94       tmp.print_raw("_coh");
 95     }
 96 #endif
 97     tmp.print_raw(".jsa");
 98     _default_archive_path = os::strdup(tmp.base());
 99   }
100   return _default_archive_path;
101 }
102 
103 int CDSConfig::num_archives(const char* archive_path) {
104   if (archive_path == nullptr) {
105     return 0;
106   }
107   int npaths = 1;
108   char* p = (char*)archive_path;
109   while (*p != '\0') {
110     if (*p == os::path_separator()[0]) {
111       npaths++;
112     }
113     p++;
114   }
115   return npaths;
116 }
117 
118 void CDSConfig::extract_shared_archive_paths(const char* archive_path,
< prev index next >