8261090: Store old classfiles in static CDS archive

Reviewed-by: iklam, minqi
This commit is contained in:
Calvin Cheung 2021-04-22 15:13:29 +00:00
parent 159f5e1ede
commit 9499175064
29 changed files with 895 additions and 42 deletions

View file

@ -344,11 +344,13 @@ Symbol* Method::klass_name() const {
void Method::metaspace_pointers_do(MetaspaceClosure* it) {
log_trace(cds)("Iter(Method): %p", this);
it->push(&_constMethod);
if (!method_holder()->is_rewritten()) {
it->push(&_constMethod, MetaspaceClosure::_writable);
} else {
it->push(&_constMethod);
}
it->push(&_method_data);
it->push(&_method_counters);
Method* this_ptr = this;
}
// Attempt to return method to original state. Clear any pointers
@ -362,7 +364,7 @@ void Method::remove_unshareable_info() {
}
void Method::set_vtable_index(int index) {
if (is_shared() && !MetaspaceShared::remapped_readwrite()) {
if (is_shared() && !MetaspaceShared::remapped_readwrite() && !method_holder()->is_shared_old_klass()) {
// At runtime initialize_vtable is rerun as part of link_class_impl()
// for a shared class loaded by the non-boot loader to obtain the loader
// constraints based on the runtime classloaders' context.
@ -373,7 +375,7 @@ void Method::set_vtable_index(int index) {
}
void Method::set_itable_index(int index) {
if (is_shared() && !MetaspaceShared::remapped_readwrite()) {
if (is_shared() && !MetaspaceShared::remapped_readwrite() && !method_holder()->is_shared_old_klass()) {
// At runtime initialize_itable is rerun as part of link_class_impl()
// for a shared class loaded by the non-boot loader to obtain the loader
// constraints based on the runtime classloaders' context. The dumptime