JEP 303 and ConstantDynamic
paul.sandoz at oracle.com
Mon Aug 7 17:56:41 UTC 2017
> On 6 Aug 2017, at 07:01, Hontvári Attila <attila at hontvari.net> wrote:
> On 2017. 08. 04. 4:14, John Rose wrote:
>> On Aug 3, 2017, at 5:57 AM, Hontvári Attila <attila at hontvari.net <mailto:attila at hontvari.net>> wrote:
>>> But as I understand this, the data of the instances of the intrinsic types don't have to be known at compile-time; they only have to be known and constant at run-time.
>> That's not true. We need to be able to fold true constant expressions into
>> bootstrap method arguments and similar class file structures.
> I originally thought that almost anything that references any CP entry can refer to a CONSTANT_Dynamic, but according to JDK-8177279 only an ldc or a BootstrapMethods table can refer to a condy item.
Condy is about dynamic linking of *constant values*, they bubble up onto the stack. It does not make sense for a say a putfield instruction to refer to anything other than a symbolic reference to a field.
> Would it be possible to make the invokedynamic instruction to handle a CONSTANT_Dynamic (with type=BootstrapSpecifier) in place of a CONSTANT_InvokeDynamic? Or would it still not solve all the use cases of the JEP?
IIUC your question (an invokedynamic referring to a CONSTANT_Dynamic entry?) I don’t see how that would help.
>> (Remi uses bytecode transforms to approximate the real thing more closely.)
>> — John
More information about the valhalla-dev