Likely a bug in G1BarrierSetAssembler::oop_store_at

Dmitry Samersoff dms at
Sun Sep 1 16:06:09 UTC 2019

Hello Everybody,

I found a following code in x86 G1BarrierSetAssembler::oop_store_at

It looks like we pass the same register as both new_val and tmp2 to

I don't have x86 setup in hands so can't say how critical it is.

 // G1 barrier needs uncompressed oop for region cross check.
      if (UseCompressedOops) {
        new_val = tmp2;
        __ movptr(new_val, val);

    BarrierSetAssembler::store_at(masm, decorators, type, Address(tmp1,
0), val, noreg, noreg);

    if (needs_post_barrier) {
      g1_write_barrier_post(masm /*masm*/,
                            tmp1 /* store_adr */,
                            new_val /* new_val */,
                            rthread /* thread */,
                            tmp3 /* tmp */,
                            tmp2 /* tmp2 */);


More information about the valhalla-dev mailing list