Relates :
|
|
Relates :
|
|
Relates :
|
This java code: object.field = other_object; object.field = other_object; should be optimized by c2 as: object.field = other_object; but it's not with G1 enabled because GraphKit::g1_write_barrier_post() has: // Use Op_MemBarVolatile to achieve the effect of a StoreLoad barrier. insert_mem_bar(Op_MemBarVolatile, oop_store); which confuses StoreNode::Ideal() With the membar above commented out, the redundant store is optimized out but it seems we leave the pre/post barrier for the second store in. The membar seems too coarse grain as all is required is that store load between the write to a field and the load from the card table.