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

Conditionally compile ReservedHeapSpace compressed heap support

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 24
    • None
    • hotspot
    • master

      ReservedHeapSpace includes some code to support creating a compressed oops heap. This is currently unconditionally included and compiled. This is despite the code being inapplicable for 32bit builds, so just wasting some code space and build time for such. Further, some of this code is problematic in a 32bit build. For example, consider this line:

      https://github.com/openjdk/jdk/blob/41ee582df8c65f2f26b21e46784cf0bc4ece0585/src/hotspot/share/memory/virtualspace.cpp#L559
      {code:c++}
          if (aligned_heap_base_min_address + size <= (char *)UnscaledOopHeapMax) {
      {code}

      UnscaledOopHeapMax is a a const uint64_t whose value is a 1 in bit 64 and 0s in all other bits. Conversion of this value to a 32bit pointer is implementation-defined. gcc discards the high bits, treating it as a conversion of zero to a pointer. Surprisingly, this triggers a -Wzero-as-null-pointer-constant warning (maybe with only some gcc versions?).

      We should only include the compressed oops heap support for 64bit builds.

            kbarrett Kim Barrett
            kbarrett Kim Barrett
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: