hotspot/src/share/vm/classfile/systemDictionary.cpp
changeset 9630 d6419e4395e3
parent 9172 a4e13ccafc44
child 10008 d84de97ad847
--- a/hotspot/src/share/vm/classfile/systemDictionary.cpp	Fri May 06 12:12:29 2011 -0700
+++ b/hotspot/src/share/vm/classfile/systemDictionary.cpp	Fri May 06 16:33:13 2011 -0700
@@ -2362,8 +2362,15 @@
       spe = invoke_method_table()->find_entry(index, hash, signature, name_id);
       if (spe == NULL)
         spe = invoke_method_table()->add_entry(index, hash, signature, name_id);
-      if (spe->property_oop() == NULL)
+      if (spe->property_oop() == NULL) {
         spe->set_property_oop(m());
+        // Link m to his method type, if it is suitably generic.
+        oop mtform = java_lang_invoke_MethodType::form(mt());
+        if (mtform != NULL && mt() == java_lang_invoke_MethodTypeForm::erasedType(mtform)
+            && java_lang_invoke_MethodTypeForm::vmlayout_offset_in_bytes() > 0) {
+          java_lang_invoke_MethodTypeForm::init_vmlayout(mtform, m());
+        }
+      }
     } else {
       non_cached_result = m;
     }