RFR: Implement stable access optimization on arrays

Roman Kennke rkennke at redhat.com
Thu Dec 20 22:02:35 UTC 2018


While poking around, I found out that our
+ShenandoahOptimizeStableFinals optimization only handles stable fields.
It does not handle array contents like in String.java (and a lot of
other places):

    @Stable
    private final byte[] value;

i.e. @Stable means that not only the reference to the array is stable
(e.g. final), but also the array contents is treated as such.

The proposed patch extends our optimization to treat stable array
elements as final too, and elide barriers on such. This gives us a
slight advantage for, e.g., String-heavy code.

http://cr.openjdk.java.net/~rkennke/stable-arrays/webrev.00/

Testing: hotspot_gc_shenandoah, specjvm/jbb with
+ShenandoahOptimizeStableFinals

Roman



More information about the shenandoah-dev mailing list