src/share/vm/memory/filemap.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File
*** old/src/share/vm/memory/filemap.cpp	Wed Sep 14 11:20:36 2016
--- new/src/share/vm/memory/filemap.cpp	Wed Sep 14 11:20:36 2016

*** 177,186 **** --- 177,187 ---- _narrow_klass_base = Universe::narrow_klass_base(); _narrow_klass_shift = Universe::narrow_klass_shift(); _classpath_entry_table_size = mapinfo->_classpath_entry_table_size; _classpath_entry_table = mapinfo->_classpath_entry_table; _classpath_entry_size = mapinfo->_classpath_entry_size; + _num_patch_mod_prefixes = ClassLoader::num_patch_mod_prefixes(); // The following fields are for sanity checks for whether this archive // will function correctly with this JVM and the bootclasspath it's // invoked with.
*** 909,923 **** --- 910,919 ---- if (VerifySharedSpaces && compute_crc() != _crc) { fail_continue("Header checksum verification failed."); return false; } if (Arguments::get_patch_mod_prefix() != NULL) { FileMapInfo::fail_continue("The shared archive file cannot be used with --patch-module."); return false; } if (!Arguments::has_jimage()) { FileMapInfo::fail_continue("The shared archive file cannot be used with an exploded module build."); return false; }
*** 950,959 **** --- 946,973 ---- _compact_strings ? "enabled" : "disabled", CompactStrings ? "enabled" : "disabled"); return false; } + // Check if there is a mismatch in --patch-module entry counts between dump time and run time. + // More check will be performed on individual --patch-module entry in the + // SharedPathsMiscInfo::check() function. + GrowableArray<ModulePatchPath*>* patch_mod_args = Arguments::get_patch_mod_prefix(); + int num_patch_mod_prefixes = _num_patch_mod_prefixes; + if (patch_mod_args != NULL) { + if (num_patch_mod_prefixes == 0) { + FileMapInfo::fail_stop("--patch-module found in run time but none was specified in dump time"); + } + if (patch_mod_args->length() != num_patch_mod_prefixes) { + FileMapInfo::fail_stop("mismatched --patch-module entry counts between dump time and run time"); + } + } else { + if (num_patch_mod_prefixes > 0) { + FileMapInfo::fail_stop("--patch-module specified in dump time but none was specified in run time"); + } + } + return true; } bool FileMapInfo::validate_header() { bool status = _header->validate();

src/share/vm/memory/filemap.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File