RFR: JDK-8204941: Refactor TemplateTable::_new to use MacroAssembler helpers for tlab and eden

Vladimir Kozlov vladimir.kozlov at oracle.com
Fri Jun 15 16:49:29 UTC 2018

Looks good to me.


On 6/13/18 4:53 AM, Roman Kennke wrote:
> TemplateTable::_new (in x86) currently has its own implementation of
> tlab and eden allocation paths, which are basically identical to the
> ones in MacroAssembler::tlab_allocate() and
> MacroAssembler::eden_allocate(). TemplateTable should use the
> MacroAssembler helpers to avoid duplication.
> The MacroAssembler version of eden_allocate() features an additional
> bounds check to prevent wraparound of obj-end. I am not sure if/how that
> can ever happen and if/how this could be exploited, but it might be
> relevant. In any case, I think it's a good thing to include it in the
> interpreter too.
> The refactoring can be taken further: fold incr_allocated_bytes() into
> eden_allocate() (they always come in pairs), probably fold
> tlab_allocate() and eden_allocate() into a single helper (they also seem
> to come in pairs mostly), also fold initialize_object/initialize_header
> sections too, but 1. I wanted to keep this manageable and 2. I also want
> to factor the tlab_allocate/eden_allocate paths into BarrierSetAssembler
> as next step (which should also include at least some of the mentioned
> unifications).
> http://cr.openjdk.java.net/~rkennke/JDK-8204941/webrev.00/
> Passes tier1_hotspot
> Can I please get a review?
> Roman

More information about the hotspot-dev mailing list