Library support for generating BSM for value type's hashCode/equals/toString
Paul Sandoz
paul.sandoz at oracle.com
Fri Jun 8 00:50:06 UTC 2018
> On Jun 7, 2018, at 5:27 PM, mandy chung <mandy.chung at oracle.com> wrote:
>
>
>
> On 6/7/18 5:00 PM, Paul Sandoz wrote:
>> Hi Mandy,
>> This looks like a great start. You mind is now suitably warped to
>> think in terms of MH combinators :-)
>
> :-)
>
> I haven't managed MethodHandles::loop - more vigorous twisting needed.
>
>> For further consideration…
>> I think you can represent the value class, the receiver type,
>> explicitly in the method type passed to the BSM, rather than use
>> Object. Then you don’t need the extra static arg, and you can pick c
>> from type.parameterType(0).
>>
>> Perhaps what you had in mind in the aptNote?
>
> Yes, we can drop the static arg once we have the javac support.
> It will get the value type from the Lookup object passed to BSM.
>
Doh! yes of course, although it might be advantageous to leverage method type now to reduce further changes to javac.
In any case one future refinement later is for the BSM to verify the method type parameter is the same as or a super type of the lookup class.
Paul.
More information about the valhalla-dev
mailing list