< prev index next >
src/hotspot/share/memory/filemap.cpp
Print this page
*** 1120,1135 ****
size_t FileMapRegion::used_aligned() const {
return align_up(used(), os::vm_allocation_granularity());
}
! void FileMapRegion::init(bool is_heap_region, char* base, size_t size, bool read_only,
bool allow_exec, int crc) {
! _is_heap_region = is_heap_region;
_mapping_offset = 0;
! if (is_heap_region) {
assert(!DynamicDumpSharedSpaces, "must be");
assert((base - (char*)CompressedKlassPointers::base()) % HeapWordSize == 0, "Sanity");
if (base != NULL) {
_mapping_offset = (size_t)CompressedOops::encode_not_null((oop)base);
assert(_mapping_offset >> 32 == 0, "must be 32-bit only");
--- 1120,1136 ----
size_t FileMapRegion::used_aligned() const {
return align_up(used(), os::vm_allocation_granularity());
}
! void FileMapRegion::init(int region_index, char* base, size_t size, bool read_only,
bool allow_exec, int crc) {
! _is_heap_region = HeapShared::is_heap_region(region_index);
! _is_bitmap_region = (region_index == MetaspaceShared::bm);
_mapping_offset = 0;
! if (_is_heap_region) {
assert(!DynamicDumpSharedSpaces, "must be");
assert((base - (char*)CompressedKlassPointers::base()) % HeapWordSize == 0, "Sanity");
if (base != NULL) {
_mapping_offset = (size_t)CompressedOops::encode_not_null((oop)base);
assert(_mapping_offset >> 32 == 0, "must be 32-bit only");
*** 1167,1177 ****
log_info(cds)("Shared file region %d: " SIZE_FORMAT_HEX_W(08)
" bytes, addr " INTPTR_FORMAT " file offset " SIZE_FORMAT_HEX_W(08),
region, size, p2i(requested_base), _file_offset);
int crc = ClassLoader::crc32(0, base, (jint)size);
! si->init(HeapShared::is_heap_region(region), target_base, size, read_only, allow_exec, crc);
if (base != NULL) {
write_bytes_aligned(base, size);
}
}
--- 1168,1178 ----
log_info(cds)("Shared file region %d: " SIZE_FORMAT_HEX_W(08)
" bytes, addr " INTPTR_FORMAT " file offset " SIZE_FORMAT_HEX_W(08),
region, size, p2i(requested_base), _file_offset);
int crc = ClassLoader::crc32(0, base, (jint)size);
! si->init(region, target_base, size, read_only, allow_exec, crc);
if (base != NULL) {
write_bytes_aligned(base, size);
}
}
*** 1466,1475 ****
--- 1467,1477 ----
if (!rs.is_reserved()) {
// When mapping on Windows with (addr_delta == 0), we don't reserve the address space for the regions
// (Windows can't mmap into a ReservedSpace). In this case, NMT requires we call it after
// os::map_memory has succeeded.
+ assert(MetaspaceShared::use_windows_memory_mapping(), "Windows memory mapping only");
MemTracker::record_virtual_memory_type((address)requested_addr, mtClassShared);
}
if (VerifySharedSpaces && !verify_region_checksum(i)) {
return MAP_ARCHIVE_OTHER_FAILURE;
< prev index next >