Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions src/hotspot/share/code/compiledIC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -561,15 +561,14 @@ void CompiledIC::compute_monomorphic_entry(const methodHandle& method,

bool CompiledIC::is_icholder_entry(address entry) {
CodeBlob* cb = CodeCache::find_blob(entry);
if (cb != nullptr && cb->is_adapter_blob()) {
return true;
if (cb == nullptr) {
return false;
}
// itable stubs also use CompiledICHolder
if (cb != nullptr && cb->is_vtable_blob()) {
VtableStub* s = VtableStubs::entry_point(entry);
return (s != nullptr) && s->is_itable_stub();
if (cb->is_adapter_blob()) {
return true;
} else if (cb->is_vtable_blob()) {
return VtableStubs::is_icholder_entry(entry);
}

return false;
}

Expand Down
7 changes: 7 additions & 0 deletions src/hotspot/share/code/vtableStubs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,13 @@ VtableStub* VtableStubs::entry_point(address pc) {
return (s == stub) ? s : nullptr;
}

bool VtableStubs::is_icholder_entry(address pc) {
assert(contains(pc), "must contain all vtable blobs");
VtableStub* stub = (VtableStub*)(pc - VtableStub::entry_offset());
// itable stubs use CompiledICHolder.
return stub->is_itable_stub();
}

bool VtableStubs::contains(address pc) {
// simple solution for now - we may want to use
// a faster way if this function is called often
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/code/vtableStubs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ class VtableStubs : AllStatic {
static address find_itable_stub(int itable_index) { return find_stub(false, itable_index); }

static VtableStub* entry_point(address pc); // vtable stub entry point for a pc
static bool is_icholder_entry(address pc); // is the blob containing pc (which must be a vtable blob) an icholder?
static bool contains(address pc); // is pc within any stub?
static VtableStub* stub_containing(address pc); // stub containing pc or nullptr
static int number_of_vtable_stubs() { return _number_of_vtable_stubs; }
Expand Down