RFR: Improve abstraction for runtime allocations

Roman Kennke rkennke at redhat.com
Sun May 13 16:45:48 UTC 2018


Am 09.05.2018 um 00:12 schrieb Roman Kennke:
> This improves (IMO) the GC interface abstraction for allocations in the
> runtime. The idea is that much like GC owns heap access (loads and
> stores, etc), the GC should also own allocations. Specifically, speaking
> from Shenandoah perspective, it should be fully to GCs discretion how
> much actual space is allocated, how it is laid out, etc. The way it is
> currently done is actually close to this, but not quite: TLAB
> allocations are outside of the GC interface, and the GC has no real good
> way to intercept those. That is why we added
> CH::tlab_post_allocation_setup() to perform additional setup after
> allocating objects from TLABs (to initialize the forwarding pointer).
> 
> This patch changes CH::mem_allocate() to also be responsible for
> allocations from TLABs, if the GC wishes to do that. This means that all
> the heap implementations need to explicitely call
> CH::allocate_from_tlab() to support TLAB allocations. On the good side,
> Shenandoah now has full control over object size and forwarding pointer
> setup, without ugly insertions into shared code.
> 
> I intend to upstream the non-Shenandoah parts soonish, after some time
> to review+bake in Shenandoah.
> 
> I also intend to implement something equivalent (and later upstream) for
> interpreter, C1 and C2 separately.
> 
> Tests: hotspot_gc_shenandoah
> 
> http://cr.openjdk.java.net/~rkennke/allocations-rt/webrev.00/
> 
> Ok?
> 
> Roman
> 

This rebases the patch on top of the PLAB change. It basically reverts
some changes in plab that I needed to do there:

Diff:
http://cr.openjdk.java.net/~rkennke/allocations-rt/webrev.01.diff/
Full:
http://cr.openjdk.java.net/~rkennke/allocations-rt/webrev.01/

still passes hotspot_gc_shenandoah



More information about the shenandoah-dev mailing list