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