RFR: Improve abstraction for runtime allocations
Roman Kennke
rkennke at redhat.com
Tue May 8 22:12:33 UTC 2018
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
More information about the shenandoah-dev
mailing list