mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-25 15:20:11 +00:00
8354484: SIGSEGV when supertype of an AOT-cached class is excluded
Reviewed-by: ccheung, shade
This commit is contained in:
parent
594b26516e
commit
e020752ea4
@ -207,11 +207,36 @@ void AOTArtifactFinder::add_aot_inited_class(InstanceKlass* ik) {
|
||||
}
|
||||
}
|
||||
|
||||
void AOTArtifactFinder::append_to_all_cached_classes(Klass* k) {
|
||||
precond(!SystemDictionaryShared::should_be_excluded(k));
|
||||
_all_cached_classes->append(k);
|
||||
}
|
||||
|
||||
void AOTArtifactFinder::add_cached_instance_class(InstanceKlass* ik) {
|
||||
if (CDSConfig::is_dumping_dynamic_archive() && ik->is_shared()) {
|
||||
// This class is already included in the base archive. No need to cache
|
||||
// it again in the dynamic archive.
|
||||
return;
|
||||
}
|
||||
|
||||
bool created;
|
||||
_seen_classes->put_if_absent(ik, &created);
|
||||
if (created) {
|
||||
_all_cached_classes->append(ik);
|
||||
append_to_all_cached_classes(ik);
|
||||
|
||||
// All super types must be added.
|
||||
InstanceKlass* s = ik->java_super();
|
||||
if (s != nullptr) {
|
||||
add_cached_instance_class(s);
|
||||
}
|
||||
|
||||
Array<InstanceKlass*>* interfaces = ik->local_interfaces();
|
||||
int len = interfaces->length();
|
||||
for (int i = 0; i < len; i++) {
|
||||
InstanceKlass* intf = interfaces->at(i);
|
||||
add_cached_instance_class(intf);
|
||||
}
|
||||
|
||||
if (CDSConfig::is_dumping_final_static_archive() && ik->is_shared_unregistered_class()) {
|
||||
// The following are not appliable to unregistered classes
|
||||
return;
|
||||
@ -229,7 +254,7 @@ void AOTArtifactFinder::add_cached_type_array_class(TypeArrayKlass* tak) {
|
||||
bool created;
|
||||
_seen_classes->put_if_absent(tak, &created);
|
||||
if (created) {
|
||||
_all_cached_classes->append(tak);
|
||||
append_to_all_cached_classes(tak);
|
||||
scan_oops_in_array_class(tak);
|
||||
}
|
||||
}
|
||||
|
||||
@ -79,6 +79,7 @@ class AOTArtifactFinder : AllStatic {
|
||||
static void scan_oops_in_array_class(ArrayKlass* ak);
|
||||
static void add_cached_type_array_class(TypeArrayKlass* tak);
|
||||
static void add_cached_instance_class(InstanceKlass* ik);
|
||||
static void append_to_all_cached_classes(Klass* k);
|
||||
public:
|
||||
static void initialize();
|
||||
static void find_artifacts();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user