Skip to content
Draft
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
2 changes: 2 additions & 0 deletions src/hotspot/share/cds/cppVtables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,11 @@
// the virtual printing functions in AnyObj).

using GrowableArray_ModuleEntry_ptr = GrowableArray<ModuleEntry*>;
using GrowableArray_SigEntry = GrowableArray<SigEntry>;

#define DEBUG_CPP_VTABLE_TYPES_DO(f) \
f(GrowableArray_ModuleEntry_ptr) \
f(GrowableArray_SigEntry) \

#endif

Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/memory/metaspaceClosureType.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
f(GrowableArray) \
f(ModuleEntry) \
f(PackageEntry) \
f(SigEntry) \

#define METASPACE_CLOSURE_TYPE_DECLARE(name) name ## Type,

Expand Down
25 changes: 6 additions & 19 deletions src/hotspot/share/runtime/sharedRuntime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3424,8 +3424,6 @@ void AdapterHandlerEntry::remove_unshareable_info() {
#endif // ASSERT
_adapter_blob = nullptr;
_linked = false;
_sig_cc = nullptr;
_sig_cc_ro = nullptr;
}

class CopyAdapterTableToArchive : StackObj {
Expand Down Expand Up @@ -3505,23 +3503,6 @@ void AdapterHandlerEntry::link() {
log_warning(aot)("Failed to link AdapterHandlerEntry (fp=%s) to its code in the AOT code cache", _fingerprint->as_basic_args_string());
generate_code = true;
}

if (get_sig_cc() == nullptr) {
// Calling conventions have to be regenerated at runtime and are accessed through method adapters,
// which are archived in the AOT code cache. If the adapters are not regenerated, the
// calling conventions should be regenerated here.
CompiledEntrySignature ces;
ces.initialize_from_fingerprint(_fingerprint);
if (ces.has_scalarized_args()) {
// Save a C heap allocated version of the scalarized signature and store it in the adapter
GrowableArray<SigEntry>* heap_sig = new (mtInternal) GrowableArray<SigEntry>(ces.sig_cc()->length(), mtInternal);
heap_sig->appendAll(ces.sig_cc());
set_sig_cc(heap_sig);
heap_sig = new (mtInternal) GrowableArray<SigEntry>(ces.sig_cc_ro()->length(), mtInternal);
heap_sig->appendAll(ces.sig_cc_ro());
set_sig_cc_ro(heap_sig);
}
}
} else {
generate_code = true;
}
Expand Down Expand Up @@ -3613,6 +3594,8 @@ void AdapterHandlerEntry::metaspace_pointers_do(MetaspaceClosure* it) {
lsh.cr();
}
it->push(&_fingerprint);
it->push(&_sig_cc);
it->push(&_sig_cc_ro);
}

AdapterHandlerEntry::~AdapterHandlerEntry() {
Expand Down Expand Up @@ -4334,3 +4317,7 @@ JRT_BLOCK_ENTRY(void, SharedRuntime::store_inline_type_fields_to_buf(JavaThread*
JRT_BLOCK_END;
}
JRT_END

void SigEntry::metaspace_pointers_do(MetaspaceClosure* it) {
it->push(&_name);
}
12 changes: 6 additions & 6 deletions src/hotspot/share/runtime/sharedRuntime.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -734,8 +734,8 @@ class AdapterHandlerEntry : public MetaspaceObj {
static const char *_entry_names[];

// Support for scalarized inline type calling convention
const GrowableArray<SigEntry>* _sig_cc;
const GrowableArray<SigEntry>* _sig_cc_ro;
GrowableArray<SigEntry>* _sig_cc;
GrowableArray<SigEntry>* _sig_cc_ro;

#ifdef ASSERT
// Captures code and signature used to generate this adapter when
Expand Down Expand Up @@ -850,16 +850,16 @@ class AdapterHandlerEntry : public MetaspaceObj {
bool is_linked() const { return _linked; }

// Support for scalarized inline type calling convention
void set_sig_cc(const GrowableArray<SigEntry>* sig) {
void set_sig_cc(GrowableArray<SigEntry>* sig) {
assert(_sig_cc == nullptr, "Already initialized");
_sig_cc = sig;
}
const GrowableArray<SigEntry>* get_sig_cc() const { return _sig_cc; }
void set_sig_cc_ro(const GrowableArray<SigEntry>* sig) {
GrowableArray<SigEntry>* get_sig_cc() const { return _sig_cc; }
void set_sig_cc_ro(GrowableArray<SigEntry>* sig) {
assert(_sig_cc_ro == nullptr, "Already initialized");
_sig_cc_ro = sig;
}
const GrowableArray<SigEntry>* get_sig_cc_ro() const { return _sig_cc_ro; }
GrowableArray<SigEntry>* get_sig_cc_ro() const { return _sig_cc_ro; }

uint id() const { return _id; }
AdapterFingerPrint* fingerprint() const { return _fingerprint; }
Expand Down
8 changes: 8 additions & 0 deletions src/hotspot/share/runtime/signature.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@

#include "classfile/symbolTable.hpp"
#include "memory/allocation.hpp"
#include "memory/metaspaceClosureType.hpp"
#include "oops/method.hpp"

class MetaspaceClosure;

// Static routines and parsing loops for processing field and method
// descriptors. In the HotSpot sources we call them "signatures".
//
Expand Down Expand Up @@ -595,6 +598,11 @@ class SigEntry {
static int fill_sig_bt(const GrowableArray<SigEntry>* sig, BasicType* sig_bt);
static TempNewSymbol create_symbol(const GrowableArray<SigEntry>* sig);

void metaspace_pointers_do(MetaspaceClosure* it);
int size_in_heapwords() const { return (int)heap_word_size(sizeof(SigEntry)); }
MetaspaceClosureType type() const { return MetaspaceClosureType::SigEntryType; }
static bool is_read_only_by_default() { return true; }

void print_on(outputStream* st) const;
};

Expand Down