2273 if (spe == NULL || spe->method() == NULL) { 2274 spe = NULL; 2275 // Must create lots of stuff here, but outside of the SystemDictionary lock. 2276 m = Method::make_method_handle_intrinsic(iid, signature, CHECK_(empty)); 2277 CompileBroker::compile_method(m, InvocationEntryBci, CompLevel_highest_tier, 2278 methodHandle(), CompileThreshold, "MH", CHECK_(empty)); 2279 2280 // Now grab the lock. We might have to throw away the new method, 2281 // if a racing thread has managed to install one at the same time. 2282 { 2283 MutexLocker ml(SystemDictionary_lock, THREAD); 2284 spe = invoke_method_table()->find_entry(index, hash, signature, iid); 2285 if (spe == NULL) 2286 spe = invoke_method_table()->add_entry(index, hash, signature, iid); 2287 if (spe->method() == NULL) 2288 spe->set_method(m()); 2289 } 2290 } 2291 2292 assert(spe != NULL && spe->method() != NULL, ""); 2293 return spe->method(); 2294 } 2295 2296 // Helper for unpacking the return value from linkMethod and linkCallSite. 2297 static methodHandle unpack_method_and_appendix(Handle mname, 2298 KlassHandle accessing_klass, 2299 objArrayHandle appendix_box, 2300 Handle* appendix_result, 2301 TRAPS) { 2302 methodHandle empty; 2303 if (mname.not_null()) { 2304 Metadata* vmtarget = java_lang_invoke_MemberName::vmtarget(mname()); 2305 if (vmtarget != NULL && vmtarget->is_method()) { 2306 Method* m = (Method*)vmtarget; 2307 oop appendix = appendix_box->obj_at(0); 2308 if (TraceMethodHandles) { 2309 #ifndef PRODUCT 2310 tty->print("Linked method=" INTPTR_FORMAT ": ", p2i(m)); 2311 m->print(); 2312 if (appendix != NULL) { tty->print("appendix = "); appendix->print(); } | 2273 if (spe == NULL || spe->method() == NULL) { 2274 spe = NULL; 2275 // Must create lots of stuff here, but outside of the SystemDictionary lock. 2276 m = Method::make_method_handle_intrinsic(iid, signature, CHECK_(empty)); 2277 CompileBroker::compile_method(m, InvocationEntryBci, CompLevel_highest_tier, 2278 methodHandle(), CompileThreshold, "MH", CHECK_(empty)); 2279 2280 // Now grab the lock. We might have to throw away the new method, 2281 // if a racing thread has managed to install one at the same time. 2282 { 2283 MutexLocker ml(SystemDictionary_lock, THREAD); 2284 spe = invoke_method_table()->find_entry(index, hash, signature, iid); 2285 if (spe == NULL) 2286 spe = invoke_method_table()->add_entry(index, hash, signature, iid); 2287 if (spe->method() == NULL) 2288 spe->set_method(m()); 2289 } 2290 } 2291 2292 assert(spe != NULL && spe->method() != NULL, ""); 2293 assert(!UseCompiler || (spe->method()->has_compiled_code() && 2294 spe->method()->code()->entry_point() == spe->method()->from_compiled_entry()), 2295 "MH intrinsic invariant"); 2296 return spe->method(); 2297 } 2298 2299 // Helper for unpacking the return value from linkMethod and linkCallSite. 2300 static methodHandle unpack_method_and_appendix(Handle mname, 2301 KlassHandle accessing_klass, 2302 objArrayHandle appendix_box, 2303 Handle* appendix_result, 2304 TRAPS) { 2305 methodHandle empty; 2306 if (mname.not_null()) { 2307 Metadata* vmtarget = java_lang_invoke_MemberName::vmtarget(mname()); 2308 if (vmtarget != NULL && vmtarget->is_method()) { 2309 Method* m = (Method*)vmtarget; 2310 oop appendix = appendix_box->obj_at(0); 2311 if (TraceMethodHandles) { 2312 #ifndef PRODUCT 2313 tty->print("Linked method=" INTPTR_FORMAT ": ", p2i(m)); 2314 m->print(); 2315 if (appendix != NULL) { tty->print("appendix = "); appendix->print(); } |