[vector] Intrinsics for fromByteArray, fromByteBuffer, intoByteArray, intoByteBuffer
Lupusoru, Razvan A
razvan.a.lupusoru at intel.com
Wed May 16 22:56:20 UTC 2018
I have created a fix for this issue here:
http://cr.openjdk.java.net/~rlupusoru/panama/webrev_intoarraycapture_00/
I do confirm that before boxing occurred - and now it no longer does. Thanks for catching this!
--Razvan
-----Original Message-----
From: Vladimir Ivanov [mailto:vladimir.x.ivanov at oracle.com]
Sent: Wednesday, May 16, 2018 1:29 AM
To: Lupusoru, Razvan A <razvan.a.lupusoru at intel.com>
Cc: panama-dev at openjdk.java.net
Subject: Re: [vector] Intrinsics for fromByteArray, fromByteBuffer, intoByteArray, intoByteBuffer
On 5/15/18 16:38, Vladimir Ivanov wrote:
>
>> 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.
To correct myself, from* methods don't matter here because they are declared on species.
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-VectorB
>> its.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