[9] RFR(S): 8136818: Test compiler/arraycopy/TestEliminatedArrayCopyDeopt.java fails with "m1 failed"

Tobias Hartmann tobias.hartmann at oracle.com
Wed Aug 3 18:29:01 UTC 2016


Hi Vladimir,

thanks for the review.

Best regards,
Tobias

On 03.08.2016 17:20, Vladimir Kozlov wrote:
> Good.
> 
> Thanks,
> Vladimir
> 
> On 8/3/16 6:32 AM, Tobias Hartmann wrote:
>> Hi,
>>
>> please review the following patch:
>> https://bugs.openjdk.java.net/browse/JDK-8136818
>> http://cr.openjdk.java.net/~thartmann/8136818/webrev.00/
>>
>> The test fails because a non-escaping allocation is removed but re-allocation after deoptimization does not initialize the object with the correct values. The problem is that with -XX:-ReduceInitialCardMarks and -XX:+UseParallelGC we emit a StoreB in the post barrier between the ArrayCopy and the MemBarStoreStore (see GraphKit::write_barrier_post() and graph [1]). PhaseMacroExpand::value_from_mem() -> scan_mem_chain() -> ArrayCopyNode::may_modify() only expects a StoreCM node and therefore does not recognize the initializing ArrayCopy. As a result, the Object is re-allocated with uninitialized values.
>>
>> I fixed this by adding the Op_StoreB case and moving the checks into ArrayCopyNode::may_modify_helper() to also recognize the card mark stores behind a Phi.
>>
>> Tested with failing test, JPRT and RBT (running).
>>
>> Thanks,
>> Tobias
>>
>> [1] https://bugs.openjdk.java.net/secure/attachment/61959/graph.png
>>


More information about the hotspot-compiler-dev mailing list