RFR: 8357660: [JVMCI] Add Support for Retrieving All Indy BootstrapMethodInvocations directly from the ConstantPool

Doug Simon dnsimon at openjdk.org
Fri May 30 15:06:30 UTC 2025


On Thu, 29 May 2025 06:04:24 GMT, Tom Shull <duke at openjdk.org> wrote:

>> I like the symmetry of the new version. Also, I think you can simplify things by replacing use of `flatMap` [here](https://github.com/openjdk/jdk/compare/master...teshull:jdk:jvmci_bootstrap_alternative#diff-b782878562668748c5c59acc2e937f7c24de4529b8a74bd3a4eae83fa0e07846R679) with `filter`.
>
> I updated the javadoc misplaced `@` in `{@code}`. However, the `opcode` doc changes look wrong to me; the opcode must be -1 or INVOKEDYNAMIC (https://github.com/openjdk/jdk/blob/04e0fe00abcf1d7919a50e0c9dd44ce2856984ea/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotConstantPool.java#L592)

yeah, looks like you're right. I was basing my assumption on `case "Dynamic"` in:

    @Override
    public BootstrapMethodInvocation lookupBootstrapMethodInvocation(int index, int opcode) {
        int cpi = opcode == -1 ? index : indyIndexConstantPoolIndex(index, opcode);
        final JvmConstant tag = getTagAt(cpi);
        switch (tag.name) {
            case "InvokeDynamic":
            case "Dynamic":

I guess it's possible for an INVOKEDYNAMIC to resolve it's cpi to a CONSTANT_Dynamic entry.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25420#discussion_r2113973088


More information about the graal-dev mailing list