changeset 4663:07119340f80f jdk7u25-b02

8009699: Methodhandle lookup Reviewed-by: ahgross, jrose, jdn
author kvn
date Fri, 15 Mar 2013 09:33:37 -0700
parents 238f85fd3c98
children cd733fbd5ca8
files src/share/vm/prims/methodHandles.cpp
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/prims/methodHandles.cpp	Tue Mar 12 14:45:11 2013 -0700
+++ b/src/share/vm/prims/methodHandles.cpp	Fri Mar 15 09:33:37 2013 -0700
@@ -645,6 +645,13 @@
         }
       }
       methodHandle m = result.resolved_method();
+      KlassHandle mklass = m->method_holder();
+      KlassHandle receiver_limit = result.resolved_klass();
+      if (receiver_limit.is_null() ||
+          // ignore passed-in limit; interfaces are interconvertible
+          receiver_limit->is_interface() && mklass->is_interface()) {
+        receiver_limit = mklass;
+      }
       oop vmtarget = NULL;
       int vmindex = methodOopDesc::nonvirtual_vtable_index;
       if (defc->is_interface()) {
@@ -665,6 +672,7 @@
       java_lang_invoke_MemberName::set_vmtarget(mname(), vmtarget);
       java_lang_invoke_MemberName::set_vmindex(mname(),  vmindex);
       java_lang_invoke_MemberName::set_modifiers(mname(), mods);
+      java_lang_invoke_MemberName::set_clazz(mname(), receiver_limit->java_mirror());
       DEBUG_ONLY(KlassHandle junk1; int junk2);
       assert(decode_MemberName(mname(), junk1, junk2) == result.resolved_method(),
              "properly stored for later decoding");