--- old/src/hotspot/share/oops/constantPool.cpp 2018-01-09 13:49:21.867913382 +0100 +++ new/src/hotspot/share/oops/constantPool.cpp 2018-01-09 13:49:21.587913392 +0100 @@ -49,9 +49,6 @@ #include "runtime/signature.hpp" #include "runtime/vframe.hpp" #include "utilities/copy.hpp" -#if INCLUDE_ALL_GCS -#include "gc/g1/g1SATBCardTableModRefBS.hpp" -#endif // INCLUDE_ALL_GCS ConstantPool* ConstantPool::allocate(ClassLoaderData* loader_data, int length, TRAPS) { Array* tags = MetadataFactory::new_array(loader_data, length, 0, CHECK_NULL); @@ -330,17 +327,13 @@ if (SystemDictionary::Object_klass_loaded()) { ClassLoaderData* loader_data = pool_holder()->class_loader_data(); #if INCLUDE_CDS_JAVA_HEAP - if (MetaspaceShared::open_archive_heap_region_mapped() && - _cache->archived_references() != NULL) { + if (MetaspaceShared::open_archive_heap_region_mapped()) { oop archived = _cache->archived_references(); - // Make sure GC knows the cached object is now live. This is necessary after - // initial GC marking and during concurrent marking as strong roots are only - // scanned during initial marking (at the start of the GC marking). - assert(UseG1GC, "Requires G1 GC"); - G1SATBCardTableModRefBS::enqueue(archived); - // Create handle for the archived resolved reference array object - Handle refs_handle(THREAD, (oop)archived); - set_resolved_references(loader_data->add_handle(refs_handle)); + if (archived != NULL) { + // Create handle for the archived resolved reference array object + Handle refs_handle(THREAD, archived); + set_resolved_references(loader_data->add_handle(refs_handle)); + } } else #endif {