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

Clean up CDS conditionals in metaspace.cpp

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Won't Fix
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:

      Description


      For instance, the large conditional in metaspace.cpp here;

      3153 if (DumpSharedSpaces) {
      3154 #if INCLUDE_CDS
      3155 MetaspaceShared::estimate_regions_size();
      3156
      ...
      3186 if (SharedMiscCodeSize < min_misc_code_size) {
      3187 report_out_of_shared_space(SharedMiscCode);
      3188 }

      Belong in metaspaceShared::align_regions_sizes() or something like that because everything it does, it prefixes with MetaspaceShared::.

      Also the macro that estimate_regions_size() use shouldn't be in the header file since it's only used in the .cpp file.

        #define SET_ESTIMATED_SIZE(type, region) \
          Shared ##region## Size = FLAG_IS_DEFAULT(Shared ##region## Size) ? \
            (uintx)(type ## SharedArchiveSize * region ## RegionPercentage) : Shared ## region ## Size


      These giant CDS conditionals make this code hard to understand and modify. This one can be trivially moved.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              coleenp Coleen Phillimore
              Reporter:
              coleenp Coleen Phillimore
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: