[lworld] RFR: object methods in VM for lworld value type (original) (raw)

John Rose john.r.rose at oracle.com
Tue May 8 04:30:12 UTC 2018


On May 7, 2018, at 6:21 AM, David Simms <david.simms at oracle.com> wrote:

Sorry for the delayed reply, inline... On 27/04/18 23:55, Karen Kinnear wrote: Mr Simms,

Yay! Thank you so much for doing the vm changes for Object methods for -Xint.

+100

Question on functionality: 1) Cloneable - this is different than we had originally discussed - so I should bring this to an EG discussion - hopefully for when you are there Sure thing. So there is a debate, choices would be that values... * May be Cloneable, but may not override clone method * Implicitly Cloneable, but may not override clone method (personally like this one) * Disallow Cloneable (current patch)

I'd prefer to disallow Cloneable for now. Either we'll discover a good use for it, and we can allow it then, or (more likely) we'll never discover a good use for it, and save confusion. It seems to me that Object.clone makes sense only for an object whose fields you can set to new values, while maintaining the object identity. That's not a value, so Object.clone should throw an exception for values. (Again, unless we discover some still-unknown use of such a thing. Not holding my breath.)

— John



More information about the valhalla-dev mailing list