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

Clean up CDS conditionals in metaspace.cpp

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • 9
    • 9
    • hotspot


      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.

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

              Created:
              Updated:
              Resolved: