Bounds checks with unsafe array access
John Rose
john.r.rose at oracle.com
Wed Sep 10 19:49:13 UTC 2014
On Sep 10, 2014, at 5:41 AM, Vitaly Davidovich <vitalyd at gmail.com> wrote:
> I think there's a fundamental problem in trying to "convey" things to the compiler. Clearly, it can't be some metadata approach since compiler can't just trust user blindly. The only way I know to convey things is through code shape.
+1
> One thing that bothers me is that even fields marked final aren't really treated as such by compiler because it's paranoid of things like reflection. If there was some way to reassure it that final fields aren't modified behind its back, then more type info can be captured at init time (e.g. array is not null and length is captured as a constant).
>
Yup. See https://bugs.openjdk.java.net/browse/JDK-6912065
Actually, this is worth tracking more carefully. So I created:
https://bugs.openjdk.java.net/browse/JDK-8058164
— John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20140910/dbc4fa57/attachment.html>
More information about the hotspot-compiler-dev
mailing list