RFR: 8258576: Try to get zerobased CCS if heap is above 32 and CDS is disabled [v2]

Richard Reingruber rrich at openjdk.java.net
Fri Dec 18 12:13:24 UTC 2020


On Fri, 18 Dec 2020 10:07:26 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:

> It would be interesting to know why aarch64 and OSX don't use shift 0 in the new test case.

HeapBaseMinAddress seems to be 2G on all platforms. On AARCH64 2G is considered invalid because it is not 4G aligned. I must admit that I don't understand this. Below 32G the CCS will be zerobased. There is no need to load the base address efficiently into a register. I think that part could be removed, don't you think that too?

bool CompressedKlassPointers::is_valid_base(address p) {
#ifdef AARCH64
  // Below 32G, base must be aligned to 4G.
  // Above that point, base must be aligned to 32G
  if (p < (address)(32 * G)) {
    return is_aligned(p, 4 * G);
  }
  return is_aligned(p, (4 << LogKlassAlignmentInBytes) * G);
#else
  return true;
#endif
}

On macos `Xlog:os*=debug` prints

[0.052s][debug][os       ] Attempt to reserve memory at 0x0000000080000000 for 1073741824 bytes failed, errno 2
errno 2 seems to be ENOENT. I don't know what this means. I don't see any mapping at 2G with vmmap.

> But the change looks good to me.
> Thanks for improving it!

Thanks for the review, Martin.

-------------

PR: https://git.openjdk.java.net/jdk/pull/1815


More information about the hotspot-runtime-dev mailing list