< prev index next >
src/hotspot/share/oops/cpCache.cpp
Print this page
rev 50453 : imported patch 02.removeInArchiveRoot
@@ -30,10 +30,11 @@
#include "interpreter/linkResolver.hpp"
#include "interpreter/rewriter.hpp"
#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"
#include "oops/constantPool.inline.hpp"
#include "oops/cpCache.inline.hpp"
@@ -741,20 +742,19 @@
set_reference_map(NULL);
}
#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<IN_ARCHIVE_ROOT>::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<IN_ARCHIVE_ROOT>::oop_store(&_archived_references, o);
+ _archived_references = CompressedOops::encode(o);
}
#endif
#if INCLUDE_JVMTI
// RedefineClasses() API support:
< prev index next >