8212817: [JVMCI] ResolvedJavaMethod.isInVirtualMethodTable throws InternalError

Reviewed-by: never, iveresov
This commit is contained in:
Doug Simon 2018-10-23 18:49:32 +02:00
parent db6696837e
commit 272eb6824b
2 changed files with 14 additions and 1 deletions

View File

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

View File

@ -429,11 +429,24 @@ public class TestResolvedJavaMethod extends MethodUniverse {
}
}
static class UnlinkedType {
}
/**
* All public non-final methods should be available in the vtable.
*/
@Test
public void testVirtualMethodTableAccess() {
ResolvedJavaType unlinkedType = metaAccess.lookupJavaType(UnlinkedType.class);
assertTrue(!unlinkedType.isLinked());
for (Class<?> c : classes) {
if (c.isInterface()) {
for (Method m : c.getDeclaredMethods()) {
ResolvedJavaMethod method = metaAccess.lookupJavaMethod(m);
method.isInVirtualMethodTable(unlinkedType);
}
}
}
for (Class<?> c : classes) {
if (c.isPrimitive() || c.isInterface()) {
continue;