[9] RFR [XS] 8054492: Casting can result in redundant null checks in generated code

Paul Sandoz paul.sandoz at oracle.com
Wed Oct 22 09:29:49 UTC 2014


On Oct 22, 2014, at 10:54 AM, Roland Westrelin <roland.westrelin at oracle.com> wrote:
>> Here is intrinsic implementation:
>> 
>> http://cr.openjdk.java.net/~kvn/8054492/webrev.01/
> 
> That looks good to me.
> 

Same here.


On Oct 22, 2014, at 2:02 AM, Vladimir Kozlov <vladimir.kozlov at oracle.com> wrote:
> Paul, is it enough for you?
> 

Yes, many thanks. I verified in a number of scenarios.

With Class.cast intrinsified can we can replace uses of following method in j.l.i.MethodHandleImpl with Class.cast?

    @ForceInline
    @SuppressWarnings("unchecked")
    static <T,U> T castReference(Class<? extends T> t, U x) {
        // inlined Class.cast because we can't ForceInline it
        if (x != null && !t.isInstance(x))
            throw newClassCastException(t, x);
        return (T) x;
    }

Paul.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20141022/3354c611/signature.asc>


More information about the hotspot-compiler-dev mailing list