RFR: 8255614: Shenandoah: Consolidate/streamline runtime LRBs

Zhengyu Gu zgu at openjdk.java.net
Fri Oct 30 13:12:05 UTC 2020


On Fri, 30 Oct 2020 11:06:54 GMT, Roman Kennke <rkennke at openjdk.org> wrote:

> Currently, our various LRB entry points are a mess, and quite inefficient too.
> - We have three entry points, one is checking for null, and calls a non-null version, but that checks for null again
> - We don't have to check for null at all: it can be subsumed in the cset-check
> - The LRB resolves forwardee even though has_forwarded_objects() and in_cset() has not been checked
> - The LRB entry is not inlineable
> 
> The proposed change coalesces the 3 entries into one, moves it to shenandoahBarrierSet.inline.hpp and make it inlineable, rearranges the impl to allow cset-check to subsume the NULL-check. As a bonus, it pushes the NULL-check around keep-alive down after the (compile-time) check for weak-ref, so that this path becomes a no-op in the majority of cases.

src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp line 83:

> 81:     return obj;
> 82:   }
> 83:   if (_heap->has_forwarded_objects() &&

Please add an assertion for obj != NULL

src/hotspot/share/gc/shenandoah/shenandoahCollectionSet.inline.hpp line 49:

> 47: bool ShenandoahCollectionSet::is_in_loc(void* p) const {
> 48:   assert(p == NULL || _heap->is_in(p), "Must be in the heap");
> 49:   uintx index = ((uintx) p) >> _region_size_bytes_shift;

Is this right? if heap is not zero-based

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

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


More information about the shenandoah-dev mailing list