Library support for generating BSM for value type's hashCode/equals/toString
mandy chung
mandy.chung at oracle.com
Fri Jun 8 00:27:22 UTC 2018
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.
Mandy
> Paul.
>
>> On Jun 7, 2018, at 3:08 PM, mandy chung <mandy.chung at oracle.com>
>> wrote:
>>
>> This is an initial library support to generate BSM for
>> hashCode/equals /toString for value types. It implements the idea
>> John laid out [1]. Srikanth will be adding javac support. Once
>> hook up, we can do more interesting experiment and improvement and
>> tease out issues.
>>
>> http://cr.openjdk.java.net/~mchung/valhalla/webrevs/value-hashcode-bsm.00/
>>
>>
>>
Mandy
>> [1]
>> http://mail.openjdk.java.net/pipermail/valhalla-dev/2018-April/004111.html
>
More information about the valhalla-dev
mailing list