RFR: 8241825: Make compressed oops and compressed class pointers independent on x86_64

Thomas Stüfe thomas.stuefe at gmail.com
Tue Apr 28 06:43:17 UTC 2020


Hi Erik,

nice change, and now I do not have to keep in mind "heap>32G = no class
space" :)

I eyeballed the metaspace changes (what little there are).

This:

-     char* base = (char*)align_up(CompressedOops::end(),
_reserve_alignment);+     char* base;+     if (UseCompressedOops) {+
    base = (char*)align_up(CompressedOops::end(),
_reserve_alignment);+     } else {+       base =
(char*)HeapBaseMinAddress;+     }

may not work as intended. You probably want the end of the reserved
heap as attach point for ccs, not the HeapBaseMinAddress.

Also, could we have some tests which exercise cds/metaspace initialization
without coops and with ccps? Easiest way would be to extend
"CompressedOops/CompressedClassPointers.java" by some cases.

Thank you, Thomas



On Fri, Apr 24, 2020 at 10:19 AM Erik Österlund <erik.osterlund at oracle.com>
wrote:

> Hi,
>
> Today, the use of compressed class pointers assumes the use of
> compressed oops.
> This patch loosens up the relationship between compressed oops and
> compressed
> class pointers, so that compressed class pointers can be used without
> compressed
> oops. This benefits for example ZGC that wants compressed class
> pointers, but
> not compressed oops, effectively giving ZGC 4 bytes smaller objects.
>
> Much of the complexity of the change is that r12 used to be used by
> compressed
> class pointers as some kind of semi-fast temp register that one would
> restore
> to the compressed oops heap base (or zero). That made it effectively a
> slightly
> optimized spilling mechanism used to find a temp register. I replaced that
> mechanism with a plain old normal temp register that you pass in as a
> parameter.
> The bad news is that I had to find available temp registers in a lot of
> places.
> The good news is that almost always were there temp registers available
> for free,
> and hence the new temp register is even faster than the old optimized
> spilling
> mechanism. Because we almost never need any spilling at all in the
> contexts where
> this is used.
>
> Since I want the 4 new bytes to actually make objects smaller, I poked
> the new
> layout code a bit so that the klass gap is made available for fields.
> That used
> to be made available only with compressed oops enabled, due to
> restrictions in
> the layout code. Our new layout code does not have such restrictions, and
> so
> I will make the 4 bytes available for fields when the new layout code is
> used
> and compressed class pointers are used.
>
> Now I'm only fixing this for HotSpot x86_64. Ideally the use of
> compressed oops
> and compressed class pointers should not be entangled in other platforms
> and
> Graal. But that is beyond the scope of this change, and I will let them
> behave
> the way that they used to, to be potentially fixed later.
>
> Bug:
> https://bugs.openjdk.java.net/browse/JDK-8241825
>
> Webrev:
> http://cr.openjdk.java.net/~eosterlund/8241825/webrev.00/
>
> Testing:
> hs-tier1-7
>
> Thanks,
> /Erik
>


More information about the hotspot-dev mailing list