Skip to content

Commit

Permalink
take ResourceMark out of debug only
Browse files Browse the repository at this point in the history
  • Loading branch information
pchilano committed Apr 8, 2024
1 parent 33354c7 commit 1636b16
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 14 deletions.
12 changes: 0 additions & 12 deletions src/hotspot/share/interpreter/oopMapCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,18 +181,6 @@ InterpreterOopMap::InterpreterOopMap() {
#endif
}

InterpreterOopMap::~InterpreterOopMap() {
// The expectation is that the bit mask was allocated
// last in this resource area. That would make the free of the
// bit_mask effective (see how FREE_RESOURCE_ARRAY does a free).
// If it was not allocated last, there is not a correctness problem
// but the space for the bit_mask is not freed.
assert(_resource_allocate_bit_mask, "Trying to free C heap space");
if (mask_size() > small_mask_limit) {
FREE_RESOURCE_ARRAY(uintptr_t, _bit_mask[0], mask_word_size());
}
}

bool InterpreterOopMap::is_empty() const {
bool result = _method == nullptr;
assert(_method != nullptr || (_bci == 0 &&
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/share/interpreter/oopMapCache.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ class InterpreterOopMap: ResourceObj {

public:
InterpreterOopMap();
~InterpreterOopMap();

// Copy the OopMapCacheEntry in parameter "from" into this
// InterpreterOopMap. If the _bit_mask[0] in "from" points to
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/runtime/frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,6 @@ oop frame::interpreter_callee_receiver(Symbol* signature) {
void frame::oops_interpreted_do(OopClosure* f, const RegisterMap* map, bool query_oop_map_cache) const {
assert(is_interpreted_frame(), "Not an interpreted frame");
Thread *thread = Thread::current();
DEBUG_ONLY(ResourceMark rm(thread);) // ~InterpreterOopMap already handles possible deallocation of bitmask
methodHandle m (thread, interpreter_frame_method());
jint bci = interpreter_frame_bci();

Expand Down Expand Up @@ -953,6 +952,7 @@ void frame::oops_interpreted_do(OopClosure* f, const RegisterMap* map, bool quer
InterpreterFrameClosure blk(this, max_locals, m->max_stack(), f);

// process locals & expression stack
ResourceMark rm(thread);
InterpreterOopMap mask;
if (query_oop_map_cache) {
m->mask_for(bci, &mask);
Expand Down

0 comments on commit 1636b16

Please sign in to comment.