8231606: _method_ordering is not set during CDS dynamic dump time

Add the missing DynamicDumpSharedSpaces check in sort_methods(); replace the (DumpSharedSpaces || DynamicDumpSharedSpaces) with the Arguments::is_dumping_archive() function call.

Reviewed-by: iklam, coleenp, jiangli
This commit is contained in:
Calvin Cheung 2019-10-02 16:55:08 -07:00
parent 72c2079fd0
commit b08a8c5cc3
24 changed files with 73 additions and 54 deletions

View file

@ -1029,7 +1029,7 @@ DumpTimeSharedClassInfo* SystemDictionaryShared::find_or_allocate_info_for(Insta
}
void SystemDictionaryShared::set_shared_class_misc_info(InstanceKlass* k, ClassFileStream* cfs) {
assert(DumpSharedSpaces || DynamicDumpSharedSpaces, "only when dumping");
Arguments::assert_is_dumping_archive();
assert(!is_builtin(k), "must be unregistered class");
DumpTimeSharedClassInfo* info = find_or_allocate_info_for(k);
info->_clsfile_size = cfs->length();
@ -1185,7 +1185,7 @@ void SystemDictionaryShared::check_excluded_classes() {
bool SystemDictionaryShared::is_excluded_class(InstanceKlass* k) {
assert(_no_class_loading_should_happen, "sanity");
assert(DumpSharedSpaces || DynamicDumpSharedSpaces, "only when dumping");
Arguments::assert_is_dumping_archive();
return find_or_allocate_info_for(k)->is_excluded();
}
@ -1209,7 +1209,7 @@ void SystemDictionaryShared::dumptime_classes_do(class MetaspaceClosure* it) {
bool SystemDictionaryShared::add_verification_constraint(InstanceKlass* k, Symbol* name,
Symbol* from_name, bool from_field_is_protected, bool from_is_array, bool from_is_object) {
assert(DumpSharedSpaces || DynamicDumpSharedSpaces, "called at dump time only");
Arguments::assert_is_dumping_archive();
DumpTimeSharedClassInfo* info = find_or_allocate_info_for(k);
info->add_verification_constraint(k, name, from_name, from_field_is_protected,
from_is_array, from_is_object);