Library support for generating BSM for value type's hashCode/equals/toString

Paul Sandoz paul.sandoz at oracle.com
Fri Jun 8 00:00:24 UTC 2018


Hi Mandy,

This looks like a great start. You mind is now suitably warped to think in terms of MH combinators :-)

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?

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