8233491: Crash in AdapterHandlerLibrary::get_adapter with CDS due to code cache exhaustion
Summary: Added null check.
Reviewed-by: kvn, iklam
--- a/src/hotspot/share/runtime/sharedRuntime.cpp Wed Nov 06 21:18:42 2019 -0500
+++ b/src/hotspot/share/runtime/sharedRuntime.cpp Thu Nov 07 07:02:55 2019 +0100
@@ -2615,7 +2615,7 @@
AdapterHandlerEntry* AdapterHandlerLibrary::get_adapter(const methodHandle& method) {
AdapterHandlerEntry* entry = get_adapter0(method);
- if (method->is_shared()) {
+ if (entry != NULL && method->is_shared()) {
// See comments around Method::link_method()
MutexLocker mu(AdapterHandlerLibrary_lock);
if (method->adapter() == NULL) {