src/hotspot/share/memory/filemap.cpp
changeset 58447 319173c62caa
parent 58277 00a98f0aa1b3
child 58494 54c1ba464b78
child 58679 9c3209ff7550
child 59070 22ee476cc664
--- a/src/hotspot/share/memory/filemap.cpp	Wed Oct 02 13:57:03 2019 -0400
+++ b/src/hotspot/share/memory/filemap.cpp	Wed Oct 02 16:55:08 2019 -0700
@@ -263,7 +263,7 @@
 
 void SharedClassPathEntry::init(bool is_modules_image,
                                 ClassPathEntry* cpe, TRAPS) {
-  assert(DumpSharedSpaces || DynamicDumpSharedSpaces, "dump time only");
+  Arguments::assert_is_dumping_archive();
   _timestamp = 0;
   _filesize  = 0;
   _from_class_path_attr = false;
@@ -397,7 +397,7 @@
 }
 
 void FileMapInfo::allocate_shared_path_table() {
-  assert(DumpSharedSpaces || DynamicDumpSharedSpaces, "Sanity");
+  Arguments::assert_is_dumping_archive();
 
   EXCEPTION_MARK; // The following calls should never throw, but would exit VM on error.
   ClassLoaderData* loader_data = ClassLoaderData::the_null_class_loader_data();
@@ -444,7 +444,7 @@
 }
 
 void FileMapInfo::check_nonempty_dir_in_shared_path_table() {
-  assert(DumpSharedSpaces || DynamicDumpSharedSpaces, "dump time only");
+  Arguments::assert_is_dumping_archive();
 
   bool has_nonempty_dir = false;
 
@@ -471,7 +471,7 @@
 }
 
 void FileMapInfo::record_non_existent_class_path_entry(const char* path) {
-  assert(DumpSharedSpaces || DynamicDumpSharedSpaces, "dump time only");
+  Arguments::assert_is_dumping_archive();
   log_info(class, path)("non-existent Class-Path entry %s", path);
   if (_non_existent_class_paths == NULL) {
     _non_existent_class_paths = new (ResourceObj::C_HEAP, mtInternal)GrowableArray<const char*>(10, true);
@@ -480,7 +480,7 @@
 }
 
 int FileMapInfo::num_non_existent_class_paths() {
-  assert(DumpSharedSpaces || DynamicDumpSharedSpaces, "dump time only");
+  Arguments::assert_is_dumping_archive();
   if (_non_existent_class_paths != NULL) {
     return _non_existent_class_paths->length();
   } else {
@@ -1150,7 +1150,7 @@
 
 void FileMapInfo::write_region(int region, char* base, size_t size,
                                bool read_only, bool allow_exec) {
-  assert(DumpSharedSpaces || DynamicDumpSharedSpaces, "Dump time only");
+  Arguments::assert_is_dumping_archive();
 
   FileMapRegion* si = space_at(region);
   char* target_base = base;