notes from Valhalla meeting 5/24/17
Remi Forax
forax at univ-mlv.fr
Wed Jun 21 15:46:06 UTC 2017
Nice work John,
but i do not like with this proposal as is, i will explain why and how to fix it:
- condy is linked to a static final field but unlike invokedynamic which is a link from an invokedynamic instruction to a CONSTANT_InvokeDynamic_info,
there is no link from the static final field to the CONSTANT_ConstantDynamic_info.
Why not reuse the ConstantValue attribute [1] to reference the CONSTANT_ConstantDynamic_info instead (the constantvalue_index can be extended to allow a CONSTANT_ConstantDynamic).
- condy if a 'dy' like indy, so it should do late late binding, i.e. being initialized (run the bootstrap method) only the first time someone access to the static field exactly like with indy the bsm is called the first time you try to access the instruction.
In term of semantics, my proposal does not introduce an item in the constant pool which is resolved only by the virtue of being in the constant pool unlike any other items. If condy is linked to the ConstantValue of a field, the condy item is resolved when necessary as usual. With my ASM hat, i see how to implement it easily without having to surface the constant pool itself (at least until the items are pointed by the j.l.i.BootstrapCallInfo).
cheers,
Rémi
[1] https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.7.2
----- Mail original -----
> De: "John Rose" <john.r.rose at oracle.com>
> À: valhalla-spec-experts at openjdk.java.net
> Envoyé: Mercredi 21 Juin 2017 10:46:22
> Objet: Re: notes from Valhalla meeting 5/24/17
> On Jun 19, 2017, at 6:28 PM, John Rose <john.r.rose at oracle.com> wrote:
>>
>> I have updated the javadoc portion of the spec for constant-dynamic.
>> There are small but strategic changes to MethodType and MethodHandle,
>> as well as new classes to represent the "pull mode" of constant resolution.
>> The key changes relevant to the JVM are in package-info.html,
>> and (of course) in the forthcoming JVM spec. changes.
>>
>> http://cr.openjdk.java.net/~jrose/jvm/specdiff-condy-2017-0619.zip
>> <http://cr.openjdk.java.net/~jrose/jvm/specdiff-condy-2017-0619.zip>
>
> The forthcoming has come forth. Here is a semi-formatted and
> color-annotated diff of the JVMS outlining proposed support for
> dynamic constants, as well as some enhancements to the processing
> of bootstrap methods:
>
> http://cr.openjdk.java.net/~jrose/jvm/condy-jvms-2017-0620.html
>
> — John
More information about the valhalla-spec-observers
mailing list