diff --git a/src/hotspot/share/gc/g1/g1FullGCPrepareTask.hpp b/src/hotspot/share/gc/g1/g1FullGCPrepareTask.hpp index aeefd9fb530..7f09f0553e9 100644 --- a/src/hotspot/share/gc/g1/g1FullGCPrepareTask.hpp +++ b/src/hotspot/share/gc/g1/g1FullGCPrepareTask.hpp @@ -42,8 +42,7 @@ class G1DetermineCompactionQueueClosure : public HeapRegionClosure { G1FullCollector* _collector; uint _cur_worker; - template - inline void free_pinned_region(HeapRegion* hr); + inline void free_empty_humongous_region(HeapRegion* hr); inline bool should_compact(HeapRegion* hr) const; diff --git a/src/hotspot/share/gc/g1/g1FullGCPrepareTask.inline.hpp b/src/hotspot/share/gc/g1/g1FullGCPrepareTask.inline.hpp index f76ecca6e5a..97d4ef63847 100644 --- a/src/hotspot/share/gc/g1/g1FullGCPrepareTask.inline.hpp +++ b/src/hotspot/share/gc/g1/g1FullGCPrepareTask.inline.hpp @@ -33,13 +33,8 @@ #include "gc/g1/g1FullGCScope.hpp" #include "gc/g1/heapRegion.inline.hpp" -template -void G1DetermineCompactionQueueClosure::free_pinned_region(HeapRegion* hr) { - if (is_humongous) { - _g1h->free_humongous_region(hr, nullptr); - } else { - _g1h->free_region(hr, nullptr); - } +void G1DetermineCompactionQueueClosure::free_empty_humongous_region(HeapRegion* hr) { + _g1h->free_humongous_region(hr, nullptr); _collector->set_free(hr->hrm_index()); add_to_compaction_queue(hr); } @@ -88,7 +83,7 @@ inline bool G1DetermineCompactionQueueClosure::do_heap_region(HeapRegion* hr) { oop obj = cast_to_oop(hr->humongous_start_region()->bottom()); bool is_empty = !_collector->mark_bitmap()->is_marked(obj); if (is_empty) { - free_pinned_region(hr); + free_empty_humongous_region(hr); } else { _collector->set_has_humongous(); }