[vector] Intrinsics for fromByteArray, fromByteBuffer, intoByteArray, intoByteBuffer
Vladimir Ivanov
vladimir.x.ivanov at oracle.com
Tue May 15 23:38:59 UTC 2018
> Do you know if this applies to all of the cases that call a super method? Or is it something specific to intoArray that causes this problem?
It's the former: all (from|into)Byte(Array|Buffer) are affected. No
vector instances should be captured by lambdas representing default
implementations. Calling a super instance method captures this, so it
should be avoided.
Best regards,
Vladimir Ivanov
> -----Original Message-----
> From: panama-dev [mailto:panama-dev-bounces at openjdk.java.net] On Behalf Of Lupusoru, Razvan A
> Sent: Tuesday, May 15, 2018 9:42 AM
> To: Vladimir Ivanov <vladimir.x.ivanov at oracle.com>; panama-dev at openjdk.java.net
> Subject: RE: [vector] Intrinsics for fromByteArray, fromByteBuffer, intoByteArray, intoByteBuffer
>
> Good catch - looks like something that should be fixed. If you don't get to it, I will try to fix it later in the week. Thanks!
>
> --Razvan
>
> -----Original Message-----
> From: Vladimir Ivanov [mailto:vladimir.x.ivanov at oracle.com]
> Sent: Monday, May 14, 2018 4:45 PM
> To: Lupusoru, Razvan A <razvan.a.lupusoru at intel.com>; panama-dev at openjdk.java.net
> Subject: Re: [vector] Intrinsics for fromByteArray, fromByteBuffer, intoByteArray, intoByteBuffer
>
>
>> http://cr.openjdk.java.net/~rlupusoru/panama/webrev_frombytearr_01/
>
> src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-VectorBits.java.template
>
> - (arr, idx, v) -> v.forEach((i, a_) ->
> (($type$[])arr)[idx + i] = a_));
> + (arr, idx) -> super.intoArray(($type$[])
> arr, idx));
>
> After that change C2 can't eliminate vector box anymore in
> Vector.intoArray() case: the lambda captures "this" vector and, though
> the lambda isn't used and goes away during EA, that usage keeps the box
> from elimination.
>
> Best regards,
> Vladimir Ivanov
>
More information about the panama-dev
mailing list