New assertion in CompressedOops::decode restricts usability

Doerr, Martin martin.doerr at
Tue Nov 3 11:46:23 UTC 2020


I'd like to raise awareness of the following issue.
[1] introduced "assert(Universe::heap()->is_in..." check in CompressedOops::decode functions.
This strong assertion may help to find bugs earlier.

However, this assertion is so strong that it restricts the usability of the decode functions because it introduces heap management dependencies in the more generic CompressedOops functionality.
There are periods of time (during GC) at which we can't use " Universe::heap()->is_in" because the pointer gets switched between old and new location, but "Universe::heap()->is_in" is not yet accurate.
Seems like there's currently one affected place in PPC64 code [2]. We can easily fix that by using decode_raw in PPC64 code.

So if we expect that nobody else will ever call CompressedOops::decode function during such a phase, I can live with just adding the workaround to PPC64 code as recently discussed in [2].
But I can imagine other people running into such a problem, too, sooner or later.


Best regards,

[1] "8237363: Remove automatic is in heap verification in OopIterateClosure"

[2] "8255598: assert(Universe::heap()->is_in(result)) failed: object not in heap"

More information about the hotspot-gc-dev mailing list