src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
jdk Cdiff src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java
src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java
Print this page
rev 9065 : 8031502: JSR292: IncompatibleClassChangeError in LambdaForm for CharSequence.toString() method handle type converter
Reviewed-by: ?
*** 636,645 ****
--- 636,651 ----
// in order to pass the verifier, we need to convert this to invokevirtual in all cases
assert(member.canBeStaticallyBound()) : member;
refKind = REF_invokeVirtual;
}
+ if (member.getDeclaringClass().isInterface() && refKind == REF_invokeVirtual) {
+ // Methods from Object declared in an interface can be resolved by JVM to invokevirtual kind.
+ // Need to convert it back to invokeinterface to pass verification and make the invocation works as expected.
+ refKind = REF_invokeInterface;
+ }
+
// push arguments
for (int i = 0; i < name.arguments.length; i++) {
emitPushArgument(name, i);
}
src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File