mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 09:34:38 +02:00
8297313: Refactor APIs for calculating address of CDS archive heap regions
Reviewed-by: matsaave, ccheung
This commit is contained in:
parent
09629570f5
commit
391599bc9d
11 changed files with 228 additions and 153 deletions
|
@ -72,16 +72,18 @@ const double CLEAN_DEAD_HIGH_WATER_MARK = 0.5;
|
|||
|
||||
#if INCLUDE_CDS_JAVA_HEAP
|
||||
inline oop read_string_from_compact_hashtable(address base_address, u4 offset) {
|
||||
assert(ArchiveHeapLoader::are_archived_strings_available(), "sanity");
|
||||
if (UseCompressedOops) {
|
||||
assert(sizeof(narrowOop) == sizeof(offset), "must be");
|
||||
narrowOop v = CompressedOops::narrow_oop_cast(offset);
|
||||
return ArchiveHeapLoader::decode_from_archive(v);
|
||||
} else {
|
||||
assert(!ArchiveHeapLoader::is_loaded(), "Pointer relocation for uncompressed oops is unimplemented");
|
||||
intptr_t dumptime_oop = (uintptr_t)offset;
|
||||
assert(dumptime_oop != 0, "null strings cannot be interned");
|
||||
intptr_t runtime_oop = dumptime_oop +
|
||||
(intptr_t)FileMapInfo::current_info()->header()->heap_begin() +
|
||||
(intptr_t)ArchiveHeapLoader::runtime_delta();
|
||||
(intptr_t)ArchiveHeapLoader::mapped_heap_delta();
|
||||
return (oop)cast_to_oop(runtime_oop);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue