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