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