Skip to content

Commit bbeb6bf

Browse files
author
Ashutosh Mehra
committed
8371493: Simplify search for AdapterHandlerEntry
Reviewed-by: kvn, adinn
1 parent 405d5f7 commit bbeb6bf

File tree

3 files changed

+4
-34
lines changed

3 files changed

+4
-34
lines changed

src/hotspot/share/code/codeBlob.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -870,9 +870,10 @@ void CodeBlob::dump_for_addr(address addr, outputStream* st, bool verbose) const
870870
return;
871871
}
872872
//
873-
if (AdapterHandlerLibrary::contains(this)) {
873+
if (is_adapter_blob()) {
874874
st->print_cr(INTPTR_FORMAT " is at code_begin+%d in an AdapterHandler", p2i(addr), (int)(addr - code_begin()));
875875
AdapterHandlerLibrary::print_handler_on(st, this);
876+
return;
876877
}
877878
// the stubroutines are generated into a buffer blob
878879
StubCodeDesc* d = StubCodeDesc::desc_for(addr);

src/hotspot/share/runtime/sharedRuntime.cpp

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3396,42 +3396,12 @@ uint32_t AdapterHandlerLibrary::id(AdapterHandlerEntry* handler) {
33963396
return handler->id();
33973397
}
33983398

3399-
bool AdapterHandlerLibrary::contains(const CodeBlob* b) {
3400-
bool found = false;
3401-
#if INCLUDE_CDS
3402-
if (AOTCodeCache::is_using_adapter()) {
3403-
auto findblob_archived_table = [&] (AdapterHandlerEntry* handler) {
3404-
if (b == CodeCache::find_blob(handler->get_i2c_entry())) {
3405-
found = true;
3406-
return false; // abort iteration
3407-
} else {
3408-
return true; // keep looking
3409-
}
3410-
};
3411-
_aot_adapter_handler_table.iterate(findblob_archived_table);
3412-
}
3413-
#endif // INCLUDE_CDS
3414-
if (!found) {
3415-
auto findblob_runtime_table = [&] (AdapterFingerPrint* key, AdapterHandlerEntry* handler) {
3416-
if (b == CodeCache::find_blob(handler->get_i2c_entry())) {
3417-
found = true;
3418-
return false; // abort iteration
3419-
} else {
3420-
return true; // keep looking
3421-
}
3422-
};
3423-
assert_locked_or_safepoint(AdapterHandlerLibrary_lock);
3424-
_adapter_handler_table->iterate(findblob_runtime_table);
3425-
}
3426-
return found;
3427-
}
3428-
34293399
void AdapterHandlerLibrary::print_handler_on(outputStream* st, const CodeBlob* b) {
34303400
bool found = false;
34313401
#if INCLUDE_CDS
34323402
if (AOTCodeCache::is_using_adapter()) {
34333403
auto findblob_archived_table = [&] (AdapterHandlerEntry* handler) {
3434-
if (b == CodeCache::find_blob(handler->get_i2c_entry())) {
3404+
if (b == handler->adapter_blob()) {
34353405
found = true;
34363406
st->print("Adapter for signature: ");
34373407
handler->print_adapter_on(st);
@@ -3445,7 +3415,7 @@ void AdapterHandlerLibrary::print_handler_on(outputStream* st, const CodeBlob* b
34453415
#endif // INCLUDE_CDS
34463416
if (!found) {
34473417
auto findblob_runtime_table = [&] (AdapterFingerPrint* key, AdapterHandlerEntry* handler) {
3448-
if (b == CodeCache::find_blob(handler->get_i2c_entry())) {
3418+
if (b == handler->adapter_blob()) {
34493419
found = true;
34503420
st->print("Adapter for signature: ");
34513421
handler->print_adapter_on(st);

src/hotspot/share/runtime/sharedRuntime.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,6 @@ class AdapterHandlerLibrary: public AllStatic {
866866

867867
static void print_handler(const CodeBlob* b) { print_handler_on(tty, b); }
868868
static void print_handler_on(outputStream* st, const CodeBlob* b);
869-
static bool contains(const CodeBlob* b);
870869
static const char* name(AdapterHandlerEntry* handler);
871870
static uint32_t id(AdapterHandlerEntry* handler);
872871
#ifndef PRODUCT

0 commit comments

Comments
 (0)