mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-20 04:43:32 +00:00
8361706: Parallel weak klass link cleaning does not clean out previous klasses
Reviewed-by: eosterlund, coleenp
This commit is contained in:
parent
272e66d017
commit
99c299f098
@ -128,6 +128,6 @@ void KlassCleaningTask::work() {
|
||||
// All workers will help cleaning the classes,
|
||||
InstanceKlass* klass;
|
||||
while ((klass = claim_next_klass()) != nullptr) {
|
||||
clean_klass(klass);
|
||||
Klass::clean_weak_instanceklass_links(klass);
|
||||
}
|
||||
}
|
||||
|
||||
@ -66,10 +66,6 @@ private:
|
||||
|
||||
public:
|
||||
|
||||
void clean_klass(InstanceKlass* ik) {
|
||||
ik->clean_weak_instanceklass_links();
|
||||
}
|
||||
|
||||
void work();
|
||||
};
|
||||
|
||||
|
||||
@ -749,17 +749,20 @@ void Klass::clean_weak_klass_links(bool unloading_occurred, bool clean_alive_kla
|
||||
// Clean the implementors list and method data.
|
||||
if (clean_alive_klasses && current->is_instance_klass()) {
|
||||
InstanceKlass* ik = InstanceKlass::cast(current);
|
||||
ik->clean_weak_instanceklass_links();
|
||||
|
||||
// JVMTI RedefineClasses creates previous versions that are not in
|
||||
// the class hierarchy, so process them here.
|
||||
while ((ik = ik->previous_versions()) != nullptr) {
|
||||
ik->clean_weak_instanceklass_links();
|
||||
}
|
||||
clean_weak_instanceklass_links(ik);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Klass::clean_weak_instanceklass_links(InstanceKlass* ik) {
|
||||
ik->clean_weak_instanceklass_links();
|
||||
// JVMTI RedefineClasses creates previous versions that are not in
|
||||
// the class hierarchy, so process them here.
|
||||
while ((ik = ik->previous_versions()) != nullptr) {
|
||||
ik->clean_weak_instanceklass_links();
|
||||
}
|
||||
}
|
||||
|
||||
void Klass::metaspace_pointers_do(MetaspaceClosure* it) {
|
||||
if (log_is_enabled(Trace, aot)) {
|
||||
ResourceMark rm;
|
||||
|
||||
@ -734,7 +734,10 @@ public:
|
||||
|
||||
void clean_subklass();
|
||||
|
||||
// Clean out unnecessary weak klass links from the whole klass hierarchy.
|
||||
static void clean_weak_klass_links(bool unloading_occurred, bool clean_alive_klasses = true);
|
||||
// Clean out unnecessary weak klass links from the given InstanceKlass.
|
||||
static void clean_weak_instanceklass_links(InstanceKlass* ik);
|
||||
|
||||
// Return self, except for abstract classes with exactly 1
|
||||
// implementor. Then return the 1 concrete implementation.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user