comparison src/share/vm/classfile/systemDictionary.cpp @ 20502:13dbe89e447c

8058536: java/lang/instrument/NativeMethodPrefixAgent.java fails due to VirtualMachineError: out of space in CodeCache for method handle intrinsic Summary: Make sure MH intrinsics can be created before compiler instances Reviewed-by: kvn
author iveresov
date Fri, 26 Sep 2014 20:09:02 -0700
parents 0d78074d2444
children b12a2a9b05ca c2844108a708
comparison
equal deleted inserted replaced
20501:c204e2044c29 20502:13dbe89e447c
2274 methodHandle m; 2274 methodHandle m;
2275 if (spe == NULL || spe->method() == NULL) { 2275 if (spe == NULL || spe->method() == NULL) {
2276 spe = NULL; 2276 spe = NULL;
2277 // Must create lots of stuff here, but outside of the SystemDictionary lock. 2277 // Must create lots of stuff here, but outside of the SystemDictionary lock.
2278 m = Method::make_method_handle_intrinsic(iid, signature, CHECK_(empty)); 2278 m = Method::make_method_handle_intrinsic(iid, signature, CHECK_(empty));
2279 CompileBroker::compile_method(m, InvocationEntryBci, CompLevel_highest_tier, 2279 if (!Arguments::is_interpreter_only()) {
2280 methodHandle(), CompileThreshold, "MH", CHECK_(empty)); 2280 // Generate a compiled form of the MH intrinsic.
2281 // Check if we need to have compiled code but we don't. 2281 AdapterHandlerLibrary::create_native_wrapper(m);
2282 if (!Arguments::is_interpreter_only() && !m->has_compiled_code()) { 2282 // Check if have the compiled code.
2283 THROW_MSG_(vmSymbols::java_lang_VirtualMachineError(), 2283 if (!m->has_compiled_code()) {
2284 "out of space in CodeCache for method handle intrinsic", empty); 2284 THROW_MSG_(vmSymbols::java_lang_VirtualMachineError(),
2285 "out of space in CodeCache for method handle intrinsic", empty);
2286 }
2285 } 2287 }
2286 // Now grab the lock. We might have to throw away the new method, 2288 // Now grab the lock. We might have to throw away the new method,
2287 // if a racing thread has managed to install one at the same time. 2289 // if a racing thread has managed to install one at the same time.
2288 { 2290 {
2289 MutexLocker ml(SystemDictionary_lock, THREAD); 2291 MutexLocker ml(SystemDictionary_lock, THREAD);