8159034: 4 nashorn ant tests fail with latest jdk9-dev build with IncompatibleClassChangeError
Reviewed-by: hannesw, jlaskey
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/JavaAdapterBytecodeGenerator.java Wed Jun 08 15:53:22 2016 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/JavaAdapterBytecodeGenerator.java Wed Jun 08 20:35:23 2016 +0530
@@ -286,7 +286,7 @@
superClassName = Type.getInternalName(superClass);
generatedClassName = getGeneratedClassName(superClass, interfaces);
- cw.visit(Opcodes.V1_7, ACC_PUBLIC | ACC_SUPER, generatedClassName, null, superClassName, getInternalTypeNames(interfaces));
+ cw.visit(Opcodes.V1_8, ACC_PUBLIC | ACC_SUPER, generatedClassName, null, superClassName, getInternalTypeNames(interfaces));
generateField(GLOBAL_FIELD_NAME, SCRIPT_OBJECT_TYPE_DESCRIPTOR);
generateField(DELEGATE_FIELD_NAME, SCRIPT_OBJECT_TYPE_DESCRIPTOR);
@@ -1031,7 +1031,9 @@
if (!constructor && Modifier.isInterface(owner.getModifiers())) {
// we should call default method on the immediate "super" type - not on (possibly)
// the indirectly inherited interface class!
- mv.invokespecial(Type.getInternalName(findInvokespecialOwnerFor(owner)), name, methodDesc, false);
+ final Class<?> superType = findInvokespecialOwnerFor(owner);
+ mv.visitMethodInsn(INVOKESPECIAL, Type.getInternalName(superType), name, methodDesc,
+ Modifier.isInterface(superType.getModifiers()));
} else {
mv.invokespecial(superClassName, name, methodDesc, false);
}