< prev index next > src/hotspot/share/code/codeBlob.cpp
Print this page
if (_mutable_data == nullptr) {
vm_exit_out_of_memory(_mutable_data_size, OOM_MALLOC_ERROR, "codebuffer: no space for mutable data");
}
} else {
// We need unique and valid not null address
- assert(_mutable_data = blob_end(), "sanity");
+ assert(_mutable_data == blob_end(), "sanity");
}
set_oop_maps(oop_maps);
}
_relocation_size(0),
_content_offset(CodeBlob::align_code_offset(header_size)),
_code_offset(_content_offset),
_data_offset(size),
_frame_size(0),
+ _mutable_data_size(0),
S390_ONLY(_ctable_offset(0) COMMA)
_header_size(header_size),
_frame_complete_offset(CodeOffsets::frame_never_safe),
_kind(kind),
_caller_must_gc_arguments(false)
{
assert(is_aligned(size, oopSize), "unaligned size");
assert(is_aligned(header_size, oopSize), "unaligned size");
- assert(_mutable_data = blob_end(), "sanity");
+ assert(_mutable_data == blob_end(), "sanity");
}
void CodeBlob::restore_mutable_data(address reloc_data) {
// Relocation data is now stored as part of the mutable data area; allocate it before copy relocations
if (_mutable_data_size > 0) {
_mutable_data = (address)os::malloc(_mutable_data_size, mtCode);
if (_mutable_data == nullptr) {
vm_exit_out_of_memory(_mutable_data_size, OOM_MALLOC_ERROR, "codebuffer: no space for mutable data");
}
+ } else {
+ _mutable_data = blob_end(); // default value
}
if (_relocation_size > 0) {
+ assert(_mutable_data_size > 0, "relocation is part of mutable data section");
memcpy((address)relocation_begin(), reloc_data, relocation_size());
}
}
void CodeBlob::purge() {
assert(_mutable_data != nullptr, "should never be null");
if (_mutable_data != blob_end()) {
os::free(_mutable_data);
_mutable_data = blob_end(); // Valid not null address
}
- if (_oop_maps != nullptr) {
+ if (_oop_maps != nullptr && !AOTCodeCache::is_address_in_aot_cache((address)_oop_maps)) {
delete _oop_maps;
_oop_maps = nullptr;
}
NOT_PRODUCT(_asm_remarks.clear());
NOT_PRODUCT(_dbg_strings.clear());
void CodeBlob::prepare_for_archiving_impl() {
set_name(nullptr);
_oop_maps = nullptr;
_mutable_data = nullptr;
#ifndef PRODUCT
- asm_remarks().clear();
- dbg_strings().clear();
+ asm_remarks().clear_ref();
+ dbg_strings().clear_ref();
#endif /* PRODUCT */
}
void CodeBlob::prepare_for_archiving() {
vptr(_kind)->prepare_for_archiving(this);
CodeBlob* CodeBlob::create(CodeBlob* archived_blob,
const char* name,
address archived_reloc_data,
ImmutableOopMapSet* archived_oop_maps
- #ifndef PRODUCT
- , AsmRemarks& archived_asm_remarks
- , DbgStrings& archived_dbg_strings
- #endif // PRODUCT
)
{
ThreadInVMfromUnknown __tiv; // get to VM state in case we block on CodeCache_lock
CodeCache::gc_on_allocation();
if (code_cache_buffer != nullptr) {
blob = archived_blob->restore(code_cache_buffer,
name,
archived_reloc_data,
archived_oop_maps);
- #ifndef PRODUCT
- blob->use_remarks(archived_asm_remarks);
- archived_asm_remarks.clear();
- blob->use_strings(archived_dbg_strings);
- archived_dbg_strings.clear();
- #endif // PRODUCT
assert(blob != nullptr, "sanity check");
// Flush the code block
ICache::invalidate_range(blob->code_begin(), blob->code_size());
CodeCache::commit(blob); // Count adapters
< prev index next >