src/hotspot/share/memory/filemap.cpp
changeset 51439 0517bd2a0eda
parent 51070 2f4c3cac8556
child 51477 e77d7687c831
equal deleted inserted replaced
51438:6ca468ea3564 51439:0517bd2a0eda
   197   get_header_version(_jvm_ident);
   197   get_header_version(_jvm_ident);
   198 
   198 
   199   ClassLoaderExt::finalize_shared_paths_misc_info();
   199   ClassLoaderExt::finalize_shared_paths_misc_info();
   200   _app_class_paths_start_index = ClassLoaderExt::app_class_paths_start_index();
   200   _app_class_paths_start_index = ClassLoaderExt::app_class_paths_start_index();
   201   _app_module_paths_start_index = ClassLoaderExt::app_module_paths_start_index();
   201   _app_module_paths_start_index = ClassLoaderExt::app_module_paths_start_index();
       
   202   _max_used_path_index = ClassLoaderExt::max_used_path_index();
   202 
   203 
   203   _verify_local = BytecodeVerificationLocal;
   204   _verify_local = BytecodeVerificationLocal;
   204   _verify_remote = BytecodeVerificationRemote;
   205   _verify_remote = BytecodeVerificationRemote;
   205   _has_platform_or_app_classes = ClassLoaderExt::has_platform_or_app_classes();
   206   _has_platform_or_app_classes = ClassLoaderExt::has_platform_or_app_classes();
   206 }
   207 }
   357 void FileMapInfo::check_nonempty_dir_in_shared_path_table() {
   358 void FileMapInfo::check_nonempty_dir_in_shared_path_table() {
   358   assert(DumpSharedSpaces, "dump time only");
   359   assert(DumpSharedSpaces, "dump time only");
   359 
   360 
   360   bool has_nonempty_dir = false;
   361   bool has_nonempty_dir = false;
   361 
   362 
   362   int end = _shared_path_table_size;
   363   int last = _shared_path_table_size - 1;
   363   if (!ClassLoaderExt::has_platform_or_app_classes()) {
   364   if (last > ClassLoaderExt::max_used_path_index()) {
   364     // only check the boot path if no app class is loaded
   365      // no need to check any path beyond max_used_path_index
   365     end = ClassLoaderExt::app_class_paths_start_index();
   366      last = ClassLoaderExt::max_used_path_index();
   366   }
   367   }
   367 
   368 
   368   for (int i = 0; i < end; i++) {
   369   for (int i = 0; i <= last; i++) {
   369     SharedClassPathEntry *e = shared_path(i);
   370     SharedClassPathEntry *e = shared_path(i);
   370     if (e->is_dir()) {
   371     if (e->is_dir()) {
   371       const char* path = e->name();
   372       const char* path = e->name();
   372       if (!os::dir_is_empty(path)) {
   373       if (!os::dir_is_empty(path)) {
   373         tty->print_cr("Error: non-empty directory '%s'", path);
   374         tty->print_cr("Error: non-empty directory '%s'", path);
   465   _shared_path_entry_size = _header->_shared_path_entry_size;
   466   _shared_path_entry_size = _header->_shared_path_entry_size;
   466   _shared_path_table_size = _header->_shared_path_table_size;
   467   _shared_path_table_size = _header->_shared_path_table_size;
   467 
   468 
   468   int module_paths_start_index = _header->_app_module_paths_start_index;
   469   int module_paths_start_index = _header->_app_module_paths_start_index;
   469 
   470 
   470   // If the shared archive contain app or platform classes, validate all entries
   471   // validate the path entries up to the _max_used_path_index
   471   // in the shared path table. Otherwise, only validate the boot path entries (with
   472   for (int i=0; i < _header->_max_used_path_index + 1; i++) {
   472   // entry index < _app_class_paths_start_index).
       
   473   int count = _header->has_platform_or_app_classes() ?
       
   474               _shared_path_table_size : _header->_app_class_paths_start_index;
       
   475 
       
   476   for (int i=0; i<count; i++) {
       
   477     if (i < module_paths_start_index) {
   473     if (i < module_paths_start_index) {
   478       if (shared_path(i)->validate()) {
   474       if (shared_path(i)->validate()) {
   479         log_info(class, path)("ok");
   475         log_info(class, path)("ok");
   480       }
   476       }
   481     } else if (i >= module_paths_start_index) {
   477     } else if (i >= module_paths_start_index) {