Skip to content

Commit

Permalink
8316669: ImmutableOopMapSet destructor not called
Browse files Browse the repository at this point in the history
Backport-of: 3d6e775d7135919519a9748036cd20b6c130bb42
  • Loading branch information
GoeLin committed Apr 3, 2024
1 parent 7c5ff9a commit 32ab4a2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/hotspot/share/code/codeBlob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,10 @@ void RuntimeBlob::free(RuntimeBlob* blob) {
}

void CodeBlob::flush() {
FREE_C_HEAP_ARRAY(unsigned char, _oop_maps);
_oop_maps = nullptr;
if (_oop_maps != nullptr) {
delete _oop_maps;
_oop_maps = nullptr;
}
NOT_PRODUCT(_asm_remarks.clear());
NOT_PRODUCT(_dbg_strings.clear());
}
Expand All @@ -190,7 +192,6 @@ void CodeBlob::set_oop_maps(OopMapSet* p) {
}
}


void RuntimeBlob::trace_new_stub(RuntimeBlob* stub, const char* name1, const char* name2) {
// Do not hold the CodeCache lock during name formatting.
assert(!CodeCache_lock->owned_by_self(), "release CodeCache before registering the stub");
Expand Down
3 changes: 3 additions & 0 deletions src/hotspot/share/compiler/oopMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,9 @@ ImmutableOopMapSet* ImmutableOopMapSet::build_from(const OopMapSet* oopmap_set)
return builder.build();
}

void ImmutableOopMapSet::operator delete(void* p) {
FREE_C_HEAP_ARRAY(unsigned char, p);
}

//------------------------------DerivedPointerTable---------------------------

Expand Down
3 changes: 3 additions & 0 deletions src/hotspot/share/compiler/oopMap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,10 @@ class ImmutableOopMapSet {
address data() const { return (address) this + sizeof(*this) + sizeof(ImmutableOopMapPair) * _count; }

public:
void operator delete(void* p);

ImmutableOopMapSet(const OopMapSet* oopmap_set, int size) : _count(oopmap_set->size()), _size(size) {}
~ImmutableOopMapSet() = default;

ImmutableOopMap* oopmap_at_offset(int offset) const {
assert(offset >= 0 && offset < _size, "must be within boundaries");
Expand Down

1 comment on commit 32ab4a2

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.