Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8202750

Consider storing _dir in ClassPathDirEntry in canonical form

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 11
    • Fix Version/s: tbd
    • Component/s: hotspot
    • Labels:

      Description

      During CDS dumping in ClassLoader::create_class_path_entry(), get_canonical_path() is only called for non-directory case.

      The 'path' for the directory case could also be converted to canonical form before creating a ClassPathDirEntry. This would avoid converting the name() from a SharedClassPathEntry to canonical form before doing strcmp in ClassLoader::record_result().

      For this to work during runtime, the location() in a ModuleEntry should also be in canonical form. Otherwise, the following comparison will fail in SystemDictionaryShared::is_shared_class_visible_for_classloader():

      (strcmp(ent->name(), ClassLoader::skip_uri_protocol(mod_entry->location()->as_C_string())) == 0)) {

      Converting the location() to canonical form could be done when a module is being defined. It could be more efficient if the core lib can provide a canonicalized location to the vm via the JVM_DefineModule() api.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ccheung Calvin Cheung
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: