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

Class space argument processing can be simplified

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 21
    • 21
    • hotspot
    • b23
    • generic

    Description

      JDK-8299229 removed the last scenario that tied compressed klass pointers to compressed oops.

      In argument.cpp, we can therefore remove comments that refer to this old dependency.

      Furthermore, in `Arguments::set_use_compressed_klass_ptrs()`, we can remove the following code pieces:

      ```
        if (FLAG_IS_DEFAULT(UseCompressedClassPointers)) {
          FLAG_SET_ERGO(UseCompressedClassPointers, true);
        }
      ```

      I think this is a remnant from the time where compressed class pointers depended on compressed oops. We can now just set compressed klass pointers to true for 64-bit platforms, which has the same effect as above code.

      ```
        // Check the CompressedClassSpaceSize to make sure we use compressed klass ptrs.
        if (UseCompressedClassPointers) {
          if (CompressedClassSpaceSize > KlassEncodingMetaspaceMax) {
            warning("CompressedClassSpaceSize is too large for UseCompressedClassPointers");
            FLAG_SET_DEFAULT(UseCompressedClassPointers, false);
          }
        }
      ```

      This coding is not needed, since the CompressedClassSpaceSize option is range-checked and capped at 3GB. KlassEncodingMetaspaceMax is 32GB, so we will never hit above condition. Moreover, even if that were not the case the check would not be sufficient either, since the encoding range size is shared between CDS archive and class space, and depends on certain alignment values too. To reduce complexity, we may just remove this part.

      Attachments

        Issue Links

          Activity

            People

              stuefe Thomas Stuefe
              stuefe Thomas Stuefe
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: