RFR: (Re-)Enable arraycopy C2 optimizations for non-traversal GC

Roman Kennke rkennke at redhat.com
Mon Jun 18 19:52:35 UTC 2018


Am 18.06.2018 um 18:28 schrieb Aleksey Shipilev:
> On 06/18/2018 06:24 PM, Roman Kennke wrote:
>> Looks like I've accidentally disabled the arraycopy-to-loadstores
>> optimization wholesale during the C2 barriers merge. We actually support
>> that optimization for non-traversal-GC. Traversal GC requires more
>> complicated storeval-barriers, that will probably come when Roland's
>> work arrives.
>>
>> http://cr.openjdk.java.net/~rkennke/enable-arycopy-c2-opt/webrev.00/
>>
>> Testing: tier3_gc_shenandoah (ongoing)
>>
>> Ok?
> 
> OK! Minor nit, double new-line:
> 
>  941
>  942
> 

It turns out that this is more problematic than I thought. Especially
some code in macroArrayCopy turns oop-copies into int-copies if we
return true on this array_copy_requires_gc_barriers() method. This is of
course wrong.

The problem is that the scope of this method is too narrow: it's
basically there to check if GC requires card-marks after arraycopies,
but doesn't handle all the cases. For example, in general we want pre-
and post-barriers. Except for traversal, we only require post-barriers.
And then there are clones (and our own clone-barrier), etc etc. I
basically screwed this up when merging C2 barriers stuff.

I carefully examined the C2 barriers changes again, and made it such
that we 100% 'emulate' what we had before. This seems stable and not
cause the crash that we have observed before. It also passes all
tier3_gc_shenandoah tests. The good thing is that it now also enables
some optimizations for traversal.

http://cr.openjdk.java.net/~rkennke/enable-arycopy-c2-opt/webrev.01/

Ok now?

Roman




More information about the shenandoah-dev mailing list