From 1636b16c5413ae0e2a854cdcd4e5f9c7c9b657ec Mon Sep 17 00:00:00 2001 From: Patricio Chilano Mateo Date: Mon, 8 Apr 2024 08:59:20 -0400 Subject: [PATCH] take ResourceMark out of debug only --- src/hotspot/share/interpreter/oopMapCache.cpp | 12 ------------ src/hotspot/share/interpreter/oopMapCache.hpp | 1 - src/hotspot/share/runtime/frame.cpp | 2 +- 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/src/hotspot/share/interpreter/oopMapCache.cpp b/src/hotspot/share/interpreter/oopMapCache.cpp index f376bfc4e58c0..3c2f1dd3e35b1 100644 --- a/src/hotspot/share/interpreter/oopMapCache.cpp +++ b/src/hotspot/share/interpreter/oopMapCache.cpp @@ -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 && diff --git a/src/hotspot/share/interpreter/oopMapCache.hpp b/src/hotspot/share/interpreter/oopMapCache.hpp index 0c2e45036eb56..7378a987cc69b 100644 --- a/src/hotspot/share/interpreter/oopMapCache.hpp +++ b/src/hotspot/share/interpreter/oopMapCache.hpp @@ -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 diff --git a/src/hotspot/share/runtime/frame.cpp b/src/hotspot/share/runtime/frame.cpp index baa31f15ddcc6..40ea596842207 100644 --- a/src/hotspot/share/runtime/frame.cpp +++ b/src/hotspot/share/runtime/frame.cpp @@ -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(); @@ -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);