Skip to content

Commit 1082c0e

Browse files
author
Thomas Schatzl
committed
8317677: Specialize Vtablestubs::entry_for() for VtableBlob
Reviewed-by: thartmann, kvn
1 parent ec310fe commit 1082c0e

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

src/hotspot/share/code/compiledIC.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -559,15 +559,14 @@ void CompiledIC::compute_monomorphic_entry(const methodHandle& method,
559559

560560
bool CompiledIC::is_icholder_entry(address entry) {
561561
CodeBlob* cb = CodeCache::find_blob(entry);
562-
if (cb != nullptr && cb->is_adapter_blob()) {
563-
return true;
562+
if (cb == nullptr) {
563+
return false;
564564
}
565-
// itable stubs also use CompiledICHolder
566-
if (cb != nullptr && cb->is_vtable_blob()) {
567-
VtableStub* s = VtableStubs::entry_point(entry);
568-
return (s != nullptr) && s->is_itable_stub();
565+
if (cb->is_adapter_blob()) {
566+
return true;
567+
} else if (cb->is_vtable_blob()) {
568+
return VtableStubs::is_icholder_entry(entry);
569569
}
570-
571570
return false;
572571
}
573572

src/hotspot/share/code/vtableStubs.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,13 @@ VtableStub* VtableStubs::entry_point(address pc) {
284284
return (s == stub) ? s : nullptr;
285285
}
286286

287+
bool VtableStubs::is_icholder_entry(address pc) {
288+
assert(contains(pc), "must contain all vtable blobs");
289+
VtableStub* stub = (VtableStub*)(pc - VtableStub::entry_offset());
290+
// itable stubs use CompiledICHolder.
291+
return stub->is_itable_stub();
292+
}
293+
287294
bool VtableStubs::contains(address pc) {
288295
// simple solution for now - we may want to use
289296
// a faster way if this function is called often

src/hotspot/share/code/vtableStubs.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ class VtableStubs : AllStatic {
106106
static address find_itable_stub(int itable_index) { return find_stub(false, itable_index); }
107107

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

0 commit comments

Comments
 (0)