< prev index next >

src/hotspot/share/cds/aotClassLocation.cpp

Print this page

 636           if (strcmp(tmp_array.at(i)->path(), libname) == 0) {
 637             found_duplicate = true;
 638             break;
 639           }
 640         }
 641         if (!found_duplicate) {
 642           add_class_location(current, tmp_array, libname, group, parse_manifest, /*from_cpattr*/true);
 643         }
 644       }
 645 
 646       file_start = file_end;
 647     }
 648   }
 649 }
 650 
 651 AOTClassLocation const* AOTClassLocationConfig::class_location_at(int index) const {
 652   return _class_locations->at(index);
 653 }
 654 
 655 int AOTClassLocationConfig::get_module_shared_path_index(Symbol* location) const {




 656   if (location->starts_with("jrt:", 4)) {
 657     assert(class_location_at(0)->is_modules_image(), "sanity");
 658     return 0;
 659   }
 660 
 661   if (num_module_paths() == 0) {
 662     // The archive(s) were created without --module-path option
 663     return -1;
 664   }
 665 
 666   if (!location->starts_with("file:", 5)) {
 667     return -1;
 668   }
 669 
 670   // skip_uri_protocol was also called during dump time -- see ClassLoaderExt::process_module_table()
 671   ResourceMark rm;
 672   const char* file = ClassLoader::uri_to_path(location->as_C_string());
 673   for (int i = module_path_start_index(); i < module_path_end_index(); i++) {
 674     const AOTClassLocation* cs = class_location_at(i);
 675     assert(!cs->has_unnamed_module(), "must be");

 636           if (strcmp(tmp_array.at(i)->path(), libname) == 0) {
 637             found_duplicate = true;
 638             break;
 639           }
 640         }
 641         if (!found_duplicate) {
 642           add_class_location(current, tmp_array, libname, group, parse_manifest, /*from_cpattr*/true);
 643         }
 644       }
 645 
 646       file_start = file_end;
 647     }
 648   }
 649 }
 650 
 651 AOTClassLocation const* AOTClassLocationConfig::class_location_at(int index) const {
 652   return _class_locations->at(index);
 653 }
 654 
 655 int AOTClassLocationConfig::get_module_shared_path_index(Symbol* location) const {
 656   if (location == nullptr) {
 657     return 0; // Used by java/lang/reflect/Proxy$ProxyBuilder
 658   }
 659 
 660   if (location->starts_with("jrt:", 4)) {
 661     assert(class_location_at(0)->is_modules_image(), "sanity");
 662     return 0;
 663   }
 664 
 665   if (num_module_paths() == 0) {
 666     // The archive(s) were created without --module-path option
 667     return -1;
 668   }
 669 
 670   if (!location->starts_with("file:", 5)) {
 671     return -1;
 672   }
 673 
 674   // skip_uri_protocol was also called during dump time -- see ClassLoaderExt::process_module_table()
 675   ResourceMark rm;
 676   const char* file = ClassLoader::uri_to_path(location->as_C_string());
 677   for (int i = module_path_start_index(); i < module_path_end_index(); i++) {
 678     const AOTClassLocation* cs = class_location_at(i);
 679     assert(!cs->has_unnamed_module(), "must be");
< prev index next >