RFR: 8315771: [JVMCI] Resolution of bootstrap methods with int[] static arguments [v3]

Doug Simon dnsimon at openjdk.org
Thu Sep 7 11:57:43 UTC 2023


On Thu, 7 Sep 2023 11:12:08 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:
> 
>   Add more details to the documentation and add a pseudo code example for BootstrapMethodInvocation usage

src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/CompilerToVM.java line 487:

> 485:      * {@code pool_index} and the {@code index} has to be smaller than {@code arg_count}.
> 486:      *
> 487:      * @param cpi the index of a bootstrap specifier in the constant pool

* @param cpi the index of a {@code CONSTANT_Dynamic_info} or @{code CONSTANT_InvokeDynamic_info} entry

src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/meta/ConstantPool.java line 145:

> 143:      *     cpi = staticArguments.get(1).asInt();
> 144:      *     for (int i = 0; i < argCount; ++i) {
> 145:      *         arguments[i] = lookupConstant(cpi, i);

What `lookupConstant` method is this?
Where is the usage of the new `bootstrapArgumentIndexAt` method?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15588#discussion_r1318489435
PR Review Comment: https://git.openjdk.org/jdk/pull/15588#discussion_r1318494272


More information about the hotspot-compiler-dev mailing list