--- old/src/hotspot/share/oops/cpCache.cpp 2018-06-11 16:16:24.258551089 -0400 +++ new/src/hotspot/share/oops/cpCache.cpp 2018-06-11 16:16:23.942534669 -0400 @@ -32,6 +32,7 @@ #include "logging/log.hpp" #include "memory/metadataFactory.hpp" #include "memory/metaspaceClosure.hpp" +#include "memory/metaspaceShared.hpp" #include "memory/resourceArea.hpp" #include "memory/universe.hpp" #include "oops/access.inline.hpp" @@ -743,16 +744,15 @@ #if INCLUDE_CDS_JAVA_HEAP oop ConstantPoolCache::archived_references() { - // Loading an archive root forces the oop to become strongly reachable. - // For example, if it is loaded during concurrent marking in a SATB - // collector, it will be enqueued to the SATB queue, effectively - // shading the previously white object gray. - return RootAccess::oop_load(&_archived_references); + if (CompressedOops::is_null(_archived_references)) { + return NULL; + } + return MetaspaceShared::unarchive_heap_object(CompressedOops::decode_not_null(_archived_references)); } void ConstantPoolCache::set_archived_references(oop o) { assert(DumpSharedSpaces, "called only during runtime"); - RootAccess::oop_store(&_archived_references, o); + _archived_references = CompressedOops::encode(o); } #endif