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

Revisit the argument processing logic for MetaspaceShared::disable_optimized_module_handling()

XMLWordPrintable

    • 15
    • b17

      JDK-8240245 added an optimization for module handling which has to be disabled if certain command-line flags are specified in relation to the module system or the boot classpath. For the module system flags the following code was added to Arguments::add_property:

         if (is_internal_module_property(key) ||
             strcmp(key, "jdk.module.main") == 0) {
           MetaspaceShared::disable_optimized_module_handling();
           log_info(cds)("Using optimized module handling disabled due to incompatible property: %s=%s", key, value);
         }

      There are a couple of issues with this code placement:

      1. We've added module specific property handling to general purpose code, when we already have module specific methods: Arguments::create_module_property and Arguments::create_numbered_module_property. The logic should be handled in one or both of those methods as applicable.

      2. The check is_internal_module_property(key) will be true for all module related properties, but it is far from clear that the intent is to disable the optimisation if any module related flag is provided. So this check seems far too broad. We may be getting away with this because when called from Arguments::create_numbered_module_property we have already appended a number to the key and so AFAICS we will fail to match.

      This new code is also specific to a build with INCLUDE_CDS defined and we should ensure we use the most effective mechanism to remove this code in non-CDS builds (ref: JDK-8247388).

            ccheung Calvin Cheung
            dholmes David Holmes
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: