RFR: 8315771: [JVMCI] Resolution of bootstrap methods with int[] static arguments [v5]
Sacha Coppey
duke at openjdk.org
Fri Sep 8 15:03:42 UTC 2023
On Fri, 8 Sep 2023 14:37:59 GMT, Sacha Coppey <duke at openjdk.org> wrote:
>> src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/meta/ConstantPool.java line 168:
>>
>>> 166: * Gets the static arguments with which the bootstrap method will be invoked.
>>> 167: *
>>> 168: * An argument of type {@link PrimitiveConstant} represents a {@code CONSTANT_Dynamic_info}
>>
>> Can it not be an index to any valid LDC constant? This is implied by this code in your Graal PR:
>>
>> if (constant instanceof PrimitiveConstant primitiveConstant) {
>> int argCpi = primitiveConstant.asInt();
>> Object argConstant = lookupConstant(argCpi, opcode == Opcodes.INVOKEDYNAMIC ? Opcodes.LDC : opcode, allowBootstrapMethodInvocation);
>
> Oh yes, sorry, I will fix this documentation.
>From the user point of view, a `PrimitiveConstant` can in fact only be a `ConstantDynamic`, because the other type of constant are automatically resolved in `CachedBSMArgs.get`. In the Graal PR, `lookupConstant` is a recursive call, allowing to call the associated bootstrap method.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15588#discussion_r1319984871
More information about the hotspot-compiler-dev
mailing list