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