RFR: 8255598: [PPC64] assert(Universe::heap()->is_in(result)) failed: object not in heap
Albert Mingkun Yang
ayang at openjdk.java.net
Thu Nov 5 18:38:58 UTC 2020
On Thu, 5 Nov 2020 16:46:43 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:
> JDK-8237363 introduced "assert(Universe::heap()->is_in..." check in CompressedOops::decode functions.
> This assertion restricts the usability of the decode functions. 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.
> PPC64 code has a usage of CompressedOops::decode which is affected by this problem. (It was observed with SerialGC, see JBS.)
> We could also use a weaker assertion, but seems like other people value the stronger assertion more. So I suggest to use decode_raw as workaround for PPC64.
Given the following naming pair, I would have guess that `decode_raw` can handle null properly, so the explicit check of null in this PR struck me as a surprise. Why so?
static inline oop decode_raw_not_null(narrowOop v);
static inline oop decode_raw(narrowOop v);
I think having some concise inline comments to explain why `decode_raw` is used over `decode` could improve readability.
Changes requested by ayang (Author).
More information about the hotspot-gc-dev