Skip to content

Commit 61ac2e7

Browse files
committed
[GR-48394] JDK-8314249 broke libgraal
PullRequest: labsjdk-ce/11
2 parents c2d3a3a + f7e4cde commit 61ac2e7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotConstantPool.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,15 @@ private static JavaType getJavaType(final Object type) {
719719

720720
@Override
721721
public JavaMethod lookupMethod(int rawIndex, int opcode, ResolvedJavaMethod caller) {
722-
final int cpci = rawIndexToConstantPoolCacheIndex(rawIndex, opcode);
722+
final int cpci;
723+
if (opcode == jdk.vm.ci.hotspot.HotSpotConstantPool.Bytecodes.INVOKEDYNAMIC) {
724+
if (!isInvokedynamicIndex(rawIndex)) {
725+
throw new IllegalArgumentException("expected a raw index for INVOKEDYNAMIC but got " + rawIndex);
726+
}
727+
cpci = rawIndex;
728+
} else {
729+
cpci = rawIndexToConstantPoolCacheIndex(rawIndex, opcode);
730+
}
723731
final HotSpotResolvedJavaMethod method = compilerToVM().lookupMethodInPool(this, cpci, (byte) opcode, (HotSpotResolvedJavaMethodImpl) caller);
724732
if (method != null) {
725733
return method;

0 commit comments

Comments
 (0)