mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8194741: Refactor oops in constant pool from CDS to use the Access API
Reviewed-by: coleenp, jiangli
This commit is contained in:
parent
27cf4b91d1
commit
3a7a71981a
6 changed files with 33 additions and 26 deletions
|
@ -33,6 +33,7 @@
|
|||
#include "memory/metaspaceClosure.hpp"
|
||||
#include "memory/resourceArea.hpp"
|
||||
#include "memory/universe.inline.hpp"
|
||||
#include "oops/access.inline.hpp"
|
||||
#include "oops/cpCache.hpp"
|
||||
#include "oops/objArrayOop.inline.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
|
@ -753,13 +754,16 @@ void ConstantPoolCache::deallocate_contents(ClassLoaderData* data) {
|
|||
|
||||
#if INCLUDE_CDS_JAVA_HEAP
|
||||
oop ConstantPoolCache::archived_references() {
|
||||
assert(UseSharedSpaces, "UseSharedSpaces expected.");
|
||||
return oopDesc::decode_heap_oop(_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);
|
||||
}
|
||||
|
||||
void ConstantPoolCache::set_archived_references(oop o) {
|
||||
assert(DumpSharedSpaces, "called only during runtime");
|
||||
_archived_references = oopDesc::encode_heap_oop(o);
|
||||
RootAccess<IN_ARCHIVE_ROOT>::oop_store(&_archived_references, o);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue