1.1 --- a/src/share/vm/interpreter/linkResolver.cpp Sat May 01 02:42:18 2010 -0700 1.2 +++ b/src/share/vm/interpreter/linkResolver.cpp Sat May 01 21:57:35 2010 -0700 1.3 @@ -172,14 +172,16 @@ 1.4 result = methodHandle(THREAD, ik->lookup_method_in_all_interfaces(name(), signature())); 1.5 } 1.6 1.7 -void LinkResolver::lookup_implicit_method(methodHandle& result, KlassHandle klass, symbolHandle name, symbolHandle signature, TRAPS) { 1.8 +void LinkResolver::lookup_implicit_method(methodHandle& result, 1.9 + KlassHandle klass, symbolHandle name, symbolHandle signature, 1.10 + KlassHandle current_klass, 1.11 + TRAPS) { 1.12 if (EnableMethodHandles && MethodHandles::enabled() && 1.13 klass() == SystemDictionary::MethodHandle_klass() && 1.14 methodOopDesc::is_method_handle_invoke_name(name())) { 1.15 methodOop result_oop = SystemDictionary::find_method_handle_invoke(name, 1.16 signature, 1.17 - Handle(), 1.18 - Handle(), 1.19 + current_klass, 1.20 CHECK); 1.21 if (result_oop != NULL) { 1.22 assert(result_oop->is_method_handle_invoke() && result_oop->signature() == signature(), "consistent"); 1.23 @@ -290,7 +292,7 @@ 1.24 1.25 if (resolved_method.is_null()) { 1.26 // JSR 292: see if this is an implicitly generated method MethodHandle.invoke(*...) 1.27 - lookup_implicit_method(resolved_method, resolved_klass, method_name, method_signature, CHECK); 1.28 + lookup_implicit_method(resolved_method, resolved_klass, method_name, method_signature, current_klass, CHECK); 1.29 } 1.30 1.31 if (resolved_method.is_null()) { 1.32 @@ -1058,7 +1060,8 @@ 1.33 // JSR 292: this must be an implicitly generated method MethodHandle.invokeExact(*...) 1.34 // The extra MH receiver will be inserted into the stack on every call. 1.35 methodHandle resolved_method; 1.36 - lookup_implicit_method(resolved_method, resolved_klass, method_name, method_signature, CHECK); 1.37 + KlassHandle current_klass(THREAD, pool->pool_holder()); 1.38 + lookup_implicit_method(resolved_method, resolved_klass, method_name, method_signature, current_klass, CHECK); 1.39 if (resolved_method.is_null()) { 1.40 THROW(vmSymbols::java_lang_InternalError()); 1.41 }