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

Move CDS configuration management into cdsConfig.hpp

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Delivered
    • Icon: P4 P4
    • 24
    • 22
    • hotspot

      Currently, many CDS operations are guarded by various global variables, such as DumpSharedSpaces and DynamicDumpSharedSpaces. There are also ad-hoc capabilities function like HeapShared::can_write(). So we have code like this where it's not clean what the intended condition us.

        if (DumpSharedSpaces && HeapShared::can_write()) {
          _narrow_oop_mode = CompressedOops::mode();
          _narrow_oop_base = CompressedOops::base();
          _narrow_oop_shift = CompressedOops::shift();
        }

      We should have higher-level functions for checking/setting CDS configuration. E.g.,

        if (CDSConfig::is_dumping_heap()) {
          _narrow_oop_mode = CompressedOops::mode();
          _narrow_oop_base = CompressedOops::base();
          _narrow_oop_shift = CompressedOops::shift();
        }

      In Leyden, we are implementing more capabilities in CDS that need to be conditionalized, so a more coherent set of configuration API is needed.

      This RFE is to upstream the relevant part of the CDSConfig API from the Leyden repo to the mainline JDK repo:

      https://github.com/openjdk/leyden/blob/7fe445527b18ae72da0848ea8a4792fc305181ad/src/hotspot/share/cds/cdsConfig.hpp

      =============
      Note: today we have a few high-level functions like Arguments::is_dumping_archive().

      https://github.com/openjdk/jdk/blob/e25a49a993f270c33f7929e629fb3075a11fdec9/src/hotspot/share/runtime/arguments.hpp#L528-L532

      For better modularity, these function should be moved to a new class.

      To simplify review, this RFE is divided into multiple sub tasks.

            iklam Ioi Lam
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: