comparison src/share/vm/classfile/systemDictionary.cpp @ 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 a20be10ad437
children fefb82b01d6f
comparison
equal deleted inserted replaced
16138:f315b1c0a590 16139:b7a1ece4f07b
2284 methodHandle m; 2284 methodHandle m;
2285 if (spe == NULL || spe->method() == NULL) { 2285 if (spe == NULL || spe->method() == NULL) {
2286 spe = NULL; 2286 spe = NULL;
2287 // Must create lots of stuff here, but outside of the SystemDictionary lock. 2287 // Must create lots of stuff here, but outside of the SystemDictionary lock.
2288 m = Method::make_method_handle_intrinsic(iid, signature, CHECK_(empty)); 2288 m = Method::make_method_handle_intrinsic(iid, signature, CHECK_(empty));
2289 CompileBroker::compile_method(m, InvocationEntryBci, CompLevel_highest_tier, 2289 nmethod* nm = CompileBroker::compile_method(m, InvocationEntryBci, CompLevel_highest_tier,
2290 methodHandle(), CompileThreshold, "MH", CHECK_(empty)); 2290 methodHandle(), CompileThreshold, "MH", CHECK_(empty));
2291 2291
2292 // Now grab the lock. We might have to throw away the new method, 2292 // Now grab the lock. We might have to throw away the new method,
2293 // if a racing thread has managed to install one at the same time. 2293 // if a racing thread has managed to install one at the same time.
2294 { 2294 {
2297 if (spe == NULL) 2297 if (spe == NULL)
2298 spe = invoke_method_table()->add_entry(index, hash, signature, iid); 2298 spe = invoke_method_table()->add_entry(index, hash, signature, iid);
2299 if (spe->method() == NULL) 2299 if (spe->method() == NULL)
2300 spe->set_method(m()); 2300 spe->set_method(m());
2301 } 2301 }
2302 } 2302 } else if (spe->method()->code() == NULL) {
2303 2303 nmethod* nm = CompileBroker::compile_method(spe->method(), InvocationEntryBci, CompLevel_highest_tier,
2304 assert(spe != NULL && spe->method() != NULL, ""); 2304 methodHandle(), CompileThreshold, "MH", CHECK_(empty));
2305 }
2306
2307 guarantee(spe != NULL && spe->method() != NULL && spe->method()->code() != NULL, "Could not compile a method handle intrinsic");
2305 return spe->method(); 2308 return spe->method();
2306 } 2309 }
2307 2310
2308 // Helper for unpacking the return value from linkMethod and linkCallSite. 2311 // Helper for unpacking the return value from linkMethod and linkCallSite.
2309 static methodHandle unpack_method_and_appendix(Handle mname, 2312 static methodHandle unpack_method_and_appendix(Handle mname,