--- old/src/share/vm/classfile/stringTable.cpp 2017-08-08 17:40:11.990465169 -0400 +++ new/src/share/vm/classfile/stringTable.cpp 2017-08-08 17:40:10.666389923 -0400 @@ -680,7 +680,7 @@ #if INCLUDE_CDS_JAVA_HEAP // Sharing -oop StringTable::archive_string(oop s, Thread* THREAD) { +oop StringTable::create_archived_string(oop s, Thread* THREAD) { assert(DumpSharedSpaces, "this function is only used with -Xshare:dump"); oop new_s = NULL; @@ -701,9 +701,7 @@ bool StringTable::copy_shared_string(GrowableArray *string_space, CompactStringTableWriter* writer) { - assert(UseG1GC, "Only support G1 GC"); - assert(UseCompressedOops && UseCompressedClassPointers, - "Only support UseCompressedOops and UseCompressedClassPointers enabled"); + assert(MetaspaceShared::is_heap_object_archiving_allowed(), "must be"); Thread* THREAD = Thread::current(); G1CollectedHeap::heap()->begin_archive_alloc_range(); @@ -717,7 +715,7 @@ } java_lang_String::set_hash(s, hash); - oop new_s = archive_string(s, THREAD); + oop new_s = create_archived_string(s, THREAD); if (new_s == NULL) { continue; } @@ -736,9 +734,7 @@ } void StringTable::write_to_archive(GrowableArray *string_space) { - assert(UseG1GC, "Only support G1 GC"); - assert(UseCompressedOops && UseCompressedClassPointers, - "Only support UseCompressedOops and UseCompressedClassPointers enabled"); + assert(MetaspaceShared::is_heap_object_archiving_allowed(), "must be"); _shared_table.reset(); int num_buckets = the_table()->number_of_entries() /