8159034: 4 nashorn ant tests fail with latest jdk9-dev build with IncompatibleClassChangeError
authorsundar
Wed, 08 Jun 2016 20:35:23 +0530
changeset 38899 b4b3d017b651
parent 38898 43383182cae3
child 38900 35214991a264
8159034: 4 nashorn ant tests fail with latest jdk9-dev build with IncompatibleClassChangeError Reviewed-by: hannesw, jlaskey
nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/JavaAdapterBytecodeGenerator.java
--- 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);
         }