Skip to content

[JDK-8358545] Adapt "JDK-8357660: [JVMCI] Add support for retrieving all BootstrapMethodInvocations directly from ConstantPool" #11319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common.json
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@

"COMMENT.jdks": "When adding or removing JDKs keep in sync with JDKs in ci/common.jsonnet",
"jdks": {
"galahad-jdk": {"name": "jpg-jdk", "version": "25", "build_id": "jdk-25+26-3288", "platformspecific": true, "extrabundles": ["static-libs"]},
"galahad-jdk": {"name": "jpg-jdk", "version": "25", "build_id": "jdk-25+26-3319", "platformspecific": true, "extrabundles": ["static-libs"]},

"oraclejdk17": {"name": "jpg-jdk", "version": "17.0.7", "build_id": "jdk-17.0.7+8", "platformspecific": true, "extrabundles": ["static-libs"]},
"labsjdk-ce-17": {"name": "labsjdk", "version": "ce-17.0.7+4-jvmci-23.1-b02", "platformspecific": true },
Original file line number Diff line number Diff line change
@@ -29,6 +29,7 @@

import java.io.DataInputStream;
import java.io.IOException;
import java.util.List;

import jdk.graal.compiler.core.common.LibGraalSupport;
import jdk.graal.compiler.debug.GraalError;
@@ -37,7 +38,6 @@
import jdk.graal.compiler.replacements.classfile.ClassfileConstant.FieldRef;
import jdk.graal.compiler.replacements.classfile.ClassfileConstant.Primitive;
import jdk.graal.compiler.replacements.classfile.ClassfileConstant.Utf8;

import jdk.vm.ci.meta.ConstantPool;
import jdk.vm.ci.meta.JavaConstant;
import jdk.vm.ci.meta.JavaField;
@@ -181,6 +181,11 @@ public JavaMethod lookupMethod(int index, int opcode, ResolvedJavaMethod caller)
return result;
}

@Override
public List<BootstrapMethodInvocation> lookupBootstrapMethodInvocations(boolean invokeDynamic) {
throw GraalError.unimplementedOverride(); // ExcludeFromJacocoGeneratedReport
}

@Override
public JavaType lookupType(int index, int opcode) {
return get(ClassRef.class, index).resolve(this);
Original file line number Diff line number Diff line change
@@ -185,6 +185,11 @@ public BootstrapMethodInvocation lookupBootstrapMethodInvocation(int cpi, int op
return null;
}

@Override
public List<BootstrapMethodInvocation> lookupBootstrapMethodInvocations(boolean invokeDynamic) {
return wrapped.lookupBootstrapMethodInvocations(invokeDynamic).stream().map(WrappedBootstrapMethodInvocation::new).collect(Collectors.toUnmodifiableList());
}

public class WrappedBootstrapMethodInvocation implements BootstrapMethodInvocation {

private final BootstrapMethodInvocation wrapped;
@@ -217,5 +222,15 @@ public JavaConstant getType() {
public List<JavaConstant> getStaticArguments() {
return wrapped.getStaticArguments().stream().map(WrappedConstantPool.this::lookupConstant).collect(Collectors.toList());
}

@Override
public void resolve() {
wrapped.resolve();
}

@Override
public JavaConstant lookup() {
return lookupConstant(wrapped.lookup());
}
}
}
Original file line number Diff line number Diff line change
@@ -41,6 +41,8 @@
import jdk.vm.ci.meta.ResolvedJavaMethod;
import jdk.vm.ci.meta.Signature;

import java.util.List;

public final class InterpreterConstantPool implements ConstantPool {

private final InterpreterResolvedObjectType holder;
@@ -89,6 +91,11 @@ public JavaMethod lookupMethod(int cpi, int opcode, ResolvedJavaMethod caller) {
throw VMError.intentionallyUnimplemented();
}

@Override
public List<BootstrapMethodInvocation> lookupBootstrapMethodInvocations(boolean invokeDynamic) {
throw VMError.intentionallyUnimplemented();
}

@Override
public JavaType lookupType(int cpi, int opcode) {
return (JavaType) at(cpi);
Loading
Oops, something went wrong.