8265689: JVMCI: InternalError: Class java.lang.Object does not implement interface jdk.vm.ci.meta.JavaType

Co-authored-by: Doug Simon <dnsimon@openjdk.org>
Reviewed-by: kvn, thartmann
This commit is contained in:
Vladimir Ivanov 2021-04-26 10:54:01 +00:00
parent 0d08d73537
commit 9647fb0dba
2 changed files with 4 additions and 3 deletions
src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot

@ -601,8 +601,9 @@ final class CompilerToVM {
* {@link HotSpotVMConfig#invalidVtableIndex} if {@code method} is not in {@code type}'s
* v-table.
*
* @throws InternalError if {@code type} is an interface or {@code method} is not held by an
* interface or class represented by {@code type} is not initialized
* @throws InternalError if {@code type} is an interface, {@code method} is not defined by an
* interface, {@code type} does not implement the interface defining {@code method}
* or class represented by {@code type} is not initialized
*/
native int getVtableIndexForInterfaceMethod(HotSpotResolvedObjectTypeImpl type, HotSpotResolvedJavaMethodImpl method);

@ -680,7 +680,7 @@ final class HotSpotResolvedJavaMethodImpl extends HotSpotMethod implements HotSp
return config().invalidVtableIndex;
}
if (holder.isInterface()) {
if (resolved.isInterface() || !resolved.isLinked()) {
if (resolved.isInterface() || !resolved.isLinked() || !getDeclaringClass().isAssignableFrom(resolved)) {
return config().invalidVtableIndex;
}
return getVtableIndexForInterfaceMethod(resolved);