RFR: 8337981: ShenandoahHeap::is_in should check for alive regions [v2]

Aleksey Shipilev shade at openjdk.org
Wed Aug 14 17:20:51 UTC 2024


On Tue, 13 Aug 2024 17:56:04 GMT, Roman Kennke <rkennke at openjdk.org> wrote:

>> Aleksey Shipilev has updated the pull request incrementally with three additional commits since the last revision:
>> 
>>  - Style touchups
>>  - Fixing ShenandoahReferenceProcessor
>>  - Verifier fix
>
> src/hotspot/share/gc/shenandoah/shenandoahReferenceProcessor.cpp line 96:
> 
>> 94: // Raw referent, it can be dead. You cannot dereference it, only use for nullptr
>> 95: // and bitmap checks. The decoding uses a special-case inlined CompressedOops::decode
>> 96: // method that bypasses normal oop-ness checks.
> 
> If you don't want to be treated like an actual oop, you could return a HeapWord* instead. That's still good enough for null- and bitmap-checking. Not sure if it causes a lot of casting around, if so then it's probably not worth it.

Aha, true, let's do `HeapWord*` instead. This clearly shows this is raw memory. I thought it would cause lots of casting around, but I think the marking context actually accepts `HeapWord*` for its real methods, and we only need to massage its API a little bit. In fact, I think it _saves_ a bit on casts now, since we don't have to cast twice: once in `allocated_after_mark_start`, and then for bitmap itself. I have a version for this in the works.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20492#discussion_r1717297480


More information about the shenandoah-dev mailing list