[lworld] RFR: 8247569: [lworld] Align with spec for <vnew> methods [v2]

David Simms dsimms at openjdk.org
Thu Sep 29 13:26:54 UTC 2022


On Wed, 28 Sep 2022 18:12:55 GMT, Vicente Romero <vromero at openjdk.org> wrote:

>> Value classes constructor should be named <vnew> instead of <init>. This PR can't be pushed without the corresponding support being available on the VM side
>
> Vicente Romero has updated the pull request incrementally with one additional commit since the last revision:
> 
>   removing experimental code

src/java.base/share/classes/java/lang/constant/DirectMethodHandleDescImpl.java line 67:

> 65:     DirectMethodHandleDescImpl(Kind kind, ClassDesc owner, String name, MethodTypeDesc type) {
> 66:         if (kind == CONSTRUCTOR)
> 67:             name = owner.isPrimitiveValueType() ? "<vnew>" : "<init>";

So here is an issue: `owner.isPrimitiveValueType()` simply says owner is Q-type descriptor. Need this name for Value Objects (and Q-Types), but Value Objects are L-types...

How do we differentiate here ? By using `kind` ?

-------------

PR: https://git.openjdk.org/valhalla/pull/771



More information about the valhalla-dev mailing list