mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
6939196: method handle signatures off the boot class path get linkage errors
Adjust MethodType lookup logic to search off the BCP, but not to cache those results Reviewed-by: twisti
This commit is contained in:
parent
4eb75c2df3
commit
973b1ef143
7 changed files with 150 additions and 47 deletions
|
@ -172,14 +172,16 @@ void LinkResolver::lookup_method_in_interfaces(methodHandle& result, KlassHandle
|
|||
result = methodHandle(THREAD, ik->lookup_method_in_all_interfaces(name(), signature()));
|
||||
}
|
||||
|
||||
void LinkResolver::lookup_implicit_method(methodHandle& result, KlassHandle klass, symbolHandle name, symbolHandle signature, TRAPS) {
|
||||
void LinkResolver::lookup_implicit_method(methodHandle& result,
|
||||
KlassHandle klass, symbolHandle name, symbolHandle signature,
|
||||
KlassHandle current_klass,
|
||||
TRAPS) {
|
||||
if (EnableMethodHandles && MethodHandles::enabled() &&
|
||||
klass() == SystemDictionary::MethodHandle_klass() &&
|
||||
methodOopDesc::is_method_handle_invoke_name(name())) {
|
||||
methodOop result_oop = SystemDictionary::find_method_handle_invoke(name,
|
||||
signature,
|
||||
Handle(),
|
||||
Handle(),
|
||||
current_klass,
|
||||
CHECK);
|
||||
if (result_oop != NULL) {
|
||||
assert(result_oop->is_method_handle_invoke() && result_oop->signature() == signature(), "consistent");
|
||||
|
@ -290,7 +292,7 @@ void LinkResolver::resolve_method(methodHandle& resolved_method, KlassHandle res
|
|||
|
||||
if (resolved_method.is_null()) {
|
||||
// JSR 292: see if this is an implicitly generated method MethodHandle.invoke(*...)
|
||||
lookup_implicit_method(resolved_method, resolved_klass, method_name, method_signature, CHECK);
|
||||
lookup_implicit_method(resolved_method, resolved_klass, method_name, method_signature, current_klass, CHECK);
|
||||
}
|
||||
|
||||
if (resolved_method.is_null()) {
|
||||
|
@ -1058,7 +1060,8 @@ void LinkResolver::resolve_invokedynamic(CallInfo& result, constantPoolHandle po
|
|||
// JSR 292: this must be an implicitly generated method MethodHandle.invokeExact(*...)
|
||||
// The extra MH receiver will be inserted into the stack on every call.
|
||||
methodHandle resolved_method;
|
||||
lookup_implicit_method(resolved_method, resolved_klass, method_name, method_signature, CHECK);
|
||||
KlassHandle current_klass(THREAD, pool->pool_holder());
|
||||
lookup_implicit_method(resolved_method, resolved_klass, method_name, method_signature, current_klass, CHECK);
|
||||
if (resolved_method.is_null()) {
|
||||
THROW(vmSymbols::java_lang_InternalError());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue