-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8348426: Generate binary file for -XX:AOTMode=record -XX:AOTConfiguration=file #23484
Changes from 1 commit
0e80509
163da9b
679ea82
daa33c5
8739ddf
0e77a35
74f5e29
cafd846
9f78bb9
72a7d1b
39c53cc
21f140e
8520e6c
0998d01
1ec67c1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -189,13 +189,22 @@ enum ClonedVtableKind { | |
_num_cloned_vtable_kinds | ||
}; | ||
|
||
// This is a map of all the original vtptrs. E.g., for | ||
// _orig_cpp_vtptrs and _archived_cpp_vtptrs are used for type checking in | ||
// CppVtables::get_archived_vtable(). | ||
// | ||
// _orig_cpp_vtptrs is a map of all the original vtptrs. E.g., for | ||
// ConstantPool *cp = new (...) ConstantPool(...) ; // a dynamically allocated constant pool | ||
// the following holds true: | ||
// _orig_cpp_vtptrs[ConstantPool_Kind] == ((intptr_t**)cp)[0] | ||
static intptr_t* _orig_cpp_vtptrs[_num_cloned_vtable_kinds]; // vtptrs set by the C++ compiler | ||
static intptr_t* _archived_cpp_vtptrs[_num_cloned_vtable_kinds]; // vtptrs used in the static archive | ||
// _orig_cpp_vtptrs[ConstantPool_Kind] == ((intptr_t**)cp)[0] | ||
// | ||
// _archived_cpp_vtptrs is a map of all the vptprs used by classes in a preimage. E.g., for | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for adding these comments. I think I now understand why we need Something like this:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the suggestion. I've incorporated your patch and added an assert. I also fixed While fixing the code, I found some typos in near-by comments that are also unclear, so I rewrote the comment about |
||
// InstanceKlass* k = a class loaded from the preimage; | ||
// ConstantPool* cp = k->constants(); | ||
// the following holds true: | ||
// _archived_cpp_vtptrs[ConstantPool_Kind] == ((intptr_t**)cp)[0] | ||
static bool _orig_cpp_vtptrs_inited = false; | ||
static intptr_t* _orig_cpp_vtptrs[_num_cloned_vtable_kinds]; | ||
static intptr_t* _archived_cpp_vtptrs[_num_cloned_vtable_kinds]; | ||
|
||
template <class T> | ||
void CppVtableCloner<T>::init_orig_cpp_vtptr(int kind) { | ||
|
@@ -245,7 +254,9 @@ void CppVtables::serialize(SerializeClosure* soc) { | |
CPP_VTABLE_TYPES_DO(INITIALIZE_VTABLE); | ||
} | ||
|
||
if (soc->writing() && CDSConfig::is_dumping_final_static_archive()) { | ||
if (soc->writing() && !CDSConfig::is_dumping_preimage_static_archive()) { | ||
// This table is written only when creating the preimage. It will be used | ||
// only when writing the final static archive. | ||
memset(_archived_cpp_vtptrs, 0, sizeof(_archived_cpp_vtptrs)); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I am reading this code correctly it requires that the elements in
tmp_array
have already been archived. Can we add a comment and/or an assert to that effect.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added comments about what the elements can be.
If it's not one of these types, it will be caught by the assert inside
builder->get_buffered_addr(ptr)