RFR: 8315771: [JVMCI] Resolution of bootstrap methods with int[] static arguments [v2]
Doug Simon
dnsimon at openjdk.org
Wed Sep 6 16:47:42 UTC 2023
On Wed, 6 Sep 2023 15:45:25 GMT, Sacha Coppey <duke at openjdk.org> wrote:
>> Currently, jdk.vm.ci.meta.ConstantPool.lookupBootstrapMethodInvocation does not support static arguments of type int[].
>>
>> Supporting those static arguments allows to correctly lookup the BootstrapMethodInvocation of some DynamicConstant.
>>
>> To lookup the constant at the index in the static arguments index list, an overloaded version of this method is required:
>>
>>
>> /**
>> * Gets the constant pool index of the pool entry associated with the
>> * index in the static arguments list of a bootstrap method.
>> *
>> * @param index a constant pool index
>> * @return the constant pool index associated with the static argument
>> */
>> int bootstrapArgumentIndexAt(int index)
>
> Sacha Coppey has updated the pull request incrementally with one additional commit since the last revision:
>
> Rewrite doc for bootstrapArgumentIndexAt and add second argument to access different static arguments
src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/meta/ConstantPool.java line 176:
> 174: * Gets the constant pool index of a static argument of a bootstrap specifier. Used when the list
> 175: * of static arguments in the {@link BootstrapMethodInvocation} is an {@code int[]}. The list has
> 176: * two elements. The first one is the number of arguments and the second one is the {@code cpi}.
Are you referring to `BootstrapMethodInvocation.getStaticArguments()` whose return type is `List<JavaConstant>`, not `int[]`?
> The list has two elements.
That's not consistent with [the code](https://github.com/openjdk/jdk/blob/bd477810b176696e0fd043f5594663ebcf9884cf/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp#L830-L835).
src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/meta/ConstantPool.java line 178:
> 176: * two elements. The first one is the number of arguments and the second one is the {@code cpi}.
> 177: *
> 178: * @param cpi the index of a bootstrap specifier in the constant pool
> the index of a bootstrap specifier in the constant pool
What's a bootstrap specifier? That is not mentioned anywhere else so you either have to explain it or use existing terminology.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15588#discussion_r1317556730
PR Review Comment: https://git.openjdk.org/jdk/pull/15588#discussion_r1317558470
More information about the hotspot-compiler-dev
mailing list