# HG changeset patch # User Gilles Duboscq # Date 1403112738 -7200 # Node ID b7a1ece4f07b8b4e8619b9ce67b7b1f6b4757879 # Parent f315b1c0a590561b88b06abd38a8752db20ca92d Make sure that there is always a nmethod available for the method handle intrinsics. diff -r f315b1c0a590 -r b7a1ece4f07b src/share/vm/classfile/systemDictionary.cpp --- 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(); }