mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 03:24:38 +02:00
8203480: IncompatibleClassChangeError thrown at sites linked to default interface methods
Reviewed-by: kvn
This commit is contained in:
parent
ff7db9b11a
commit
ddc42415c0
4 changed files with 96 additions and 24 deletions
|
@ -1082,6 +1082,7 @@ Handle SharedRuntime::find_callee_info_helper(JavaThread* thread,
|
|||
|
||||
Bytecode_invoke bytecode(caller, bci);
|
||||
int bytecode_index = bytecode.index();
|
||||
bc = bytecode.invoke_code();
|
||||
|
||||
methodHandle attached_method = extract_attached_method(vfst);
|
||||
if (attached_method.not_null()) {
|
||||
|
@ -1095,6 +1096,11 @@ Handle SharedRuntime::find_callee_info_helper(JavaThread* thread,
|
|||
|
||||
// Adjust invocation mode according to the attached method.
|
||||
switch (bc) {
|
||||
case Bytecodes::_invokevirtual:
|
||||
if (attached_method->method_holder()->is_interface()) {
|
||||
bc = Bytecodes::_invokeinterface;
|
||||
}
|
||||
break;
|
||||
case Bytecodes::_invokeinterface:
|
||||
if (!attached_method->method_holder()->is_interface()) {
|
||||
bc = Bytecodes::_invokevirtual;
|
||||
|
@ -1110,10 +1116,10 @@ Handle SharedRuntime::find_callee_info_helper(JavaThread* thread,
|
|||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
bc = bytecode.invoke_code();
|
||||
}
|
||||
|
||||
assert(bc != Bytecodes::_illegal, "not initialized");
|
||||
|
||||
bool has_receiver = bc != Bytecodes::_invokestatic &&
|
||||
bc != Bytecodes::_invokedynamic &&
|
||||
bc != Bytecodes::_invokehandle;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue