< prev index next >

src/hotspot/share/memory/filemap.cpp

Print this page




 318     acpe = acpe->next();
 319     i++;
 320   }
 321 
 322   // 3. module path
 323   ClassPathEntry *mpe = ClassLoader::module_path_entries();
 324   while (mpe != NULL) {
 325     log_info(class, path)("add module path %s",mpe->name());
 326     SharedClassPathEntry* ent = shared_path(i);
 327     ent->init(mpe->name(), THREAD);
 328     EXCEPTION_MARK;
 329     SharedClassUtil::update_shared_classpath(mpe, ent, THREAD);
 330     mpe = mpe->next();
 331     i++;
 332   }
 333   assert(i == num_entries, "number of shared path entry mismatch");
 334 }
 335 
 336 void FileMapInfo::check_nonempty_dir_in_shared_path_table() {
 337   assert(DumpSharedSpaces, "dump time only");



 338   int end = _shared_path_table_size;
 339   if (!ClassLoaderExt::has_platform_or_app_classes()) {
 340     // only check the boot path if no app class is loaded
 341     end = ClassLoaderExt::app_class_paths_start_index();
 342   }

 343   for (int i = 0; i < end; i++) {
 344     SharedClassPathEntry *e = shared_path(i);
 345     if (e->is_dir()) {
 346       const char* path = e->name();
 347       if (!os::dir_is_empty(path)) {
 348         tty->print_cr("Error: non-empty directory '%s'", path);
 349         ClassLoader::exit_with_path_failure("Cannot have non-empty directory in paths", NULL);

 350       }
 351     }



 352   }
 353 }
 354 
 355 bool FileMapInfo::validate_shared_path_table() {
 356   assert(UseSharedSpaces, "runtime only");
 357 
 358   _validating_shared_path_table = true;
 359   _shared_path_table = _header->_shared_path_table;
 360   _shared_path_entry_size = _header->_shared_path_entry_size;
 361   _shared_path_table_size = _header->_shared_path_table_size;
 362 
 363   FileMapHeaderExt* header = (FileMapHeaderExt*)FileMapInfo::current_info()->header();
 364   int module_paths_start_index = header->_app_module_paths_start_index;
 365 
 366   // If the shared archive contain app or platform classes, validate all entries
 367   // in the shared path table. Otherwise, only validate the boot path entries (with
 368   // entry index < _app_class_paths_start_index).
 369   int count = header->has_platform_or_app_classes() ?
 370               _shared_path_table_size : header->_app_class_paths_start_index;
 371 




 318     acpe = acpe->next();
 319     i++;
 320   }
 321 
 322   // 3. module path
 323   ClassPathEntry *mpe = ClassLoader::module_path_entries();
 324   while (mpe != NULL) {
 325     log_info(class, path)("add module path %s",mpe->name());
 326     SharedClassPathEntry* ent = shared_path(i);
 327     ent->init(mpe->name(), THREAD);
 328     EXCEPTION_MARK;
 329     SharedClassUtil::update_shared_classpath(mpe, ent, THREAD);
 330     mpe = mpe->next();
 331     i++;
 332   }
 333   assert(i == num_entries, "number of shared path entry mismatch");
 334 }
 335 
 336 void FileMapInfo::check_nonempty_dir_in_shared_path_table() {
 337   assert(DumpSharedSpaces, "dump time only");
 338 
 339   bool has_nonempty_dir = false;
 340 
 341   int end = _shared_path_table_size;
 342   if (!ClassLoaderExt::has_platform_or_app_classes()) {
 343     // only check the boot path if no app class is loaded
 344     end = ClassLoaderExt::app_class_paths_start_index();
 345   }
 346 
 347   for (int i = 0; i < end; i++) {
 348     SharedClassPathEntry *e = shared_path(i);
 349     if (e->is_dir()) {
 350       const char* path = e->name();
 351       if (!os::dir_is_empty(path)) {
 352         tty->print_cr("Error: non-empty directory '%s'", path);
 353         has_nonempty_dir = true;
 354       }
 355     }
 356   }
 357 
 358   if (has_nonempty_dir) {
 359     ClassLoader::exit_with_path_failure("Cannot have non-empty directory in paths", NULL);
 360   }
 361 }
 362 
 363 bool FileMapInfo::validate_shared_path_table() {
 364   assert(UseSharedSpaces, "runtime only");
 365 
 366   _validating_shared_path_table = true;
 367   _shared_path_table = _header->_shared_path_table;
 368   _shared_path_entry_size = _header->_shared_path_entry_size;
 369   _shared_path_table_size = _header->_shared_path_table_size;
 370 
 371   FileMapHeaderExt* header = (FileMapHeaderExt*)FileMapInfo::current_info()->header();
 372   int module_paths_start_index = header->_app_module_paths_start_index;
 373 
 374   // If the shared archive contain app or platform classes, validate all entries
 375   // in the shared path table. Otherwise, only validate the boot path entries (with
 376   // entry index < _app_class_paths_start_index).
 377   int count = header->has_platform_or_app_classes() ?
 378               _shared_path_table_size : header->_app_class_paths_start_index;
 379 


< prev index next >