Skip to content

Commit

Permalink
Automatic merge of jdk:master into master
Browse files Browse the repository at this point in the history
  • Loading branch information
duke committed Jun 16, 2021
2 parents 10cf7ee + e4908a4 commit 2c48ae7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/hotspot/share/cds/dynamicArchive.cpp
Expand Up @@ -107,9 +107,11 @@ class DynamicArchiveBuilder : public ArchiveBuilder {

verify_universe("Before CDS dynamic dump");
DEBUG_ONLY(SystemDictionaryShared::NoClassLoadingMark nclm);
SystemDictionaryShared::check_excluded_classes();

// Block concurrent class unloading from changing the _dumptime_table
MutexLocker ml(DumpTimeTable_lock, Mutex::_no_safepoint_check_flag);
SystemDictionaryShared::check_excluded_classes();

init_header();
gather_source_objs();
reserve_buffer();
Expand Down
6 changes: 2 additions & 4 deletions src/hotspot/share/cds/metaspaceShared.cpp
Expand Up @@ -484,12 +484,10 @@ void VM_PopulateDumpSharedSpace::doit() {

NOT_PRODUCT(SystemDictionary::verify();)

// At this point, many classes have been loaded.
// Gather systemDictionary classes in a global array and do everything to
// that so we don't have to walk the SystemDictionary again.
// Block concurrent class unloading from changing the _dumptime_table
MutexLocker ml(DumpTimeTable_lock, Mutex::_no_safepoint_check_flag);
SystemDictionaryShared::check_excluded_classes();

MutexLocker ml(DumpTimeTable_lock, Mutex::_no_safepoint_check_flag);
StaticArchiveBuilder builder;
builder.gather_source_objs();
builder.reserve_buffer();
Expand Down
2 changes: 2 additions & 0 deletions src/hotspot/share/classfile/systemDictionaryShared.cpp
Expand Up @@ -1485,6 +1485,8 @@ class ExcludeDumpTimeSharedClasses : StackObj {
};

void SystemDictionaryShared::check_excluded_classes() {
assert(no_class_loading_should_happen(), "sanity");
assert_lock_strong(DumpTimeTable_lock);
ExcludeDumpTimeSharedClasses excl;
_dumptime_table->iterate(&excl);
_dumptime_table->update_counts();
Expand Down

0 comments on commit 2c48ae7

Please sign in to comment.