changeset 16139:b7a1ece4f07b

Make sure that there is always a nmethod available for the method handle intrinsics.
author Gilles Duboscq <duboscq@ssw.jku.at>
date Wed, 18 Jun 2014 19:32:18 +0200
parents f315b1c0a590
children da21746a64bf
files src/share/vm/classfile/systemDictionary.cpp
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/classfile/systemDictionary.cpp	Wed Jun 18 14:21:10 2014 +0200
+++ b/src/share/vm/classfile/systemDictionary.cpp	Wed Jun 18 19:32:18 2014 +0200
@@ -2286,7 +2286,7 @@
     spe = NULL;
     // Must create lots of stuff here, but outside of the SystemDictionary lock.
     m = Method::make_method_handle_intrinsic(iid, signature, CHECK_(empty));
-    CompileBroker::compile_method(m, InvocationEntryBci, CompLevel_highest_tier,
+    nmethod* nm = CompileBroker::compile_method(m, InvocationEntryBci, CompLevel_highest_tier,
                                   methodHandle(), CompileThreshold, "MH", CHECK_(empty));
 
     // Now grab the lock.  We might have to throw away the new method,
@@ -2299,9 +2299,12 @@
       if (spe->method() == NULL)
         spe->set_method(m());
     }
+  } else if (spe->method()->code() == NULL) {
+    nmethod* nm = CompileBroker::compile_method(spe->method(), InvocationEntryBci, CompLevel_highest_tier,
+                                      methodHandle(), CompileThreshold, "MH", CHECK_(empty));
   }
 
-  assert(spe != NULL && spe->method() != NULL, "");
+  guarantee(spe != NULL && spe->method() != NULL && spe->method()->code() != NULL, "Could not compile a method handle intrinsic");
   return spe->method();
 }