RFR 8160439: Replace asserts in VarHandle.AccessMode with tests
Martin Buchholz
martinrb at google.com
Tue Jun 28 19:37:55 UTC 2016
Looks good.
I'm still nervous about using assert in performance critical code due to
hotspot bytecode count inlining heuristics.
On Tue, Jun 28, 2016 at 3:50 AM, Paul Sandoz <paul.sandoz at oracle.com> wrote:
> Hi,
>
> Please review:
>
>
> http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8160439-vh-access-mode-remove-assert/webrev/
> <
> http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8160439-vh-access-mode-remove-assert/webrev/
> >
>
> This removes an assert that can load dependent locale-based classes too
> early in the startup process when say AtomicInteger is modified to use
> VarHandle (in a 166 webrev Martin has prepared). This appears to kibosh
> locale-behaviour which was thankfully caught in a test
> (java/util/Locale/Bug4152725.java).
>
> The removed assert has been replaced with a test.
>
> —
>
> Separately there might be a more principled way to ensure VarHandle and
> dependent classes are loaded/initialized at a well defined point. Although
> in this case it would not have helped, it would help define a clearer
> barrier before which a VarHandle cannot be used.
>
> Paul.
>
More information about the core-libs-dev
mailing list