Skip to content

Commit

Permalink
8316669: ImmutableOopMapSet destructor not called
Browse files Browse the repository at this point in the history
Reviewed-by: thartmann, jvernee, kvn
  • Loading branch information
Thomas Schatzl committed Sep 25, 2023
1 parent 837783c commit 3d6e775
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 @@ -335,7 +335,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

3 comments on commit 3d6e775

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

@GoeLin
Copy link
Member

@GoeLin GoeLin commented on 3d6e775 Apr 2, 2024

Choose a reason for hiding this comment

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

/backport jdk21u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 3d6e775 Apr 2, 2024

Choose a reason for hiding this comment

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

@GoeLin the backport was successfully created on the branch backport-GoeLin-3d6e775d in my personal fork of openjdk/jdk21u-dev. To create a pull request with this backport targeting openjdk/jdk21u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 3d6e775d from the openjdk/jdk repository.

The commit being backported was authored by Thomas Schatzl on 25 Sep 2023 and was reviewed by Tobias Hartmann, Jorn Vernee and Vladimir Kozlov.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk21u-dev:

$ git fetch https://github.com/openjdk-bots/jdk21u-dev.git backport-GoeLin-3d6e775d:backport-GoeLin-3d6e775d
$ git checkout backport-GoeLin-3d6e775d
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk21u-dev.git backport-GoeLin-3d6e775d

Please sign in to comment.