RFR 8183130: [MVT] Implement intrinsics for Q-typed LambdaForms

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Wed Jul 5 13:50:02 UTC 2017


I've uploaded a new version which adds a small helper method on the 
lambda form code builder which can be used to create unique labels. This 
avoids the problem of having string concat in client code.

http://cr.openjdk.java.net/~mcimadamore/8183130_v3/

Maurizio


On 05/07/17 13:34, Vladimir Ivanov wrote:
> Looks nice!
>
> One comment:
>
> +    private Name emitLoop(int pos) {
> ...
> +        builder.label("LOOP");
> ..
> +                    .goto_("DONE")
> +                    .label("NEXT_" + c);
>
> Since lambda forms can be "extended" (see BoundMethodHandle.rebind() + 
> BMH.editor() usages), it's possible (at least, in theory) to have 
> multiple loop intrinsics in a single LF.
>
> I suggest to add position to LOOP, DONE, and NEXT labels to make them 
> unique in the context of a single lambda form:
>   "LOOP_"+pos
>   "DONE_"+pos)
>   "NEXT_" + pos + "_" + c
>
> (I hope string identifiers will be replaced with a dedicated Label 
> class to make it easier to create unique label identifiers).
>
> Best regards,
> Vladimir Ivanov
>
> On 7/5/17 3:19 PM, Maurizio Cimadamore wrote:
>> Hi,
>> I've done a bigger rewriting of the patch, (and I also removed the 
>> assertion). Now the organization is such that the intrinsic code can 
>> take more advantage of the fluent style of code builders - this is 
>> particularly evident in emitSelectAlternatives (but emitLoop has 
>> improved too).
>>
>> http://cr.openjdk.java.net/~mcimadamore/8183130_v2
>>
>> Maurizio
>>
>>
>> On 03/07/17 22:11, Maurizio Cimadamore wrote:
>>> I've missed that, sorry - I will remove the assertion
>>>
>>> Maurizio
>>>
>>>
>>> On 03/07/17 22:00, Vladimir Ivanov wrote:
>>>> From correctness POV, it's perfectly fine to miss an intrinsic 
>>>> opportunity. So, I'd prefer to avoid throwing an error until all 
>>>> intrinsics are implemented:
>>>>
>>>> +                default: {
>>>> +                    throw newInternalError("Unknown intrinsic: 
>>>> "+intr);
>>>> +                }
>>>>
>>>> Otherwise, looks good.
>>>>
>>>> Best regards,
>>>> Vladimir Ivanov
>>>>
>>>> On 7/3/17 5:27 PM, Maurizio Cimadamore wrote:
>>>>> Hi,
>>>>> This patch adds support for intrinsic in LambdaFormBuilder. More 
>>>>> intrinsics to come in separate followup patches.
>>>>>
>>>>> http://cr.openjdk.java.net/~mcimadamore/8183130/
>>>>>
>>>>> Thanks
>>>>> Maurizio
>>>>>
>>>>>
>>>
>>




More information about the valhalla-dev mailing list