RFR (S) 8031818: Experimental VM flag for enforcing safe object construction

Remi Forax forax at univ-mlv.fr
Wed Jan 22 00:44:13 PST 2014

On 01/21/2014 11:47 PM, Aleksey Shipilev wrote:
> Hi,
> Please review the experimental patch for switching the research VM mode
> which unconditionally emits the memory barrier at the end of constructor:
>    http://cr.openjdk.java.net/~shade/8031818/webrev.00/
>    https://bugs.openjdk.java.net/browse/JDK-8031818
> This would be convenient to have in mainline, because it will also
> propagate to another arch ports (notably PPC C2 port), and will ease the
> performance research for the upcoming JMM update.
> Thanks,
> -Aleksey.

My mail is a little OT but anyway, Aleksey, I don't understand why the 
performance are not mostly identical.
Correct me if I'm wrong, for TSO architecture, you basically do nothing 
so no impact. For ARM or PPC, you need a barrier but anyway you need to 
emit a barrier when you store the class pointer in the header of the 
object, so it should not perf at all the JIT is able to see that the 
class pointer is not read in the constructor
(if 'this' doesn't escape and no 
invokevirtual/invokeinterface/instanceof etc).


More information about the hotspot-compiler-dev mailing list