--- old/src/hotspot/share/gc/parallel/psCompactionManager.hpp 2019-11-11 11:10:34.833081893 +0100 +++ new/src/hotspot/share/gc/parallel/psCompactionManager.hpp 2019-11-11 11:10:34.401079750 +0100 @@ -28,6 +28,7 @@ #include "gc/shared/taskqueue.hpp" #include "memory/allocation.hpp" #include "utilities/stack.hpp" +#include "psParallelCompact.hpp" class MutableSpace; class PSOldGen; @@ -77,6 +78,7 @@ private: OverflowTaskQueue _marking_stack; ObjArrayTaskQueue _objarray_stack; + size_t _shadow_record; // Is there a way to reuse the _marking_stack for the // saving empty regions? For now just create a different @@ -85,6 +87,14 @@ static ParMarkBitMap* _mark_bitmap; + // The shadow region array, we use it in a LIFO fashion, so + // that we can reuse shadow regions for better data locality + // and utilization + static GrowableArray* _shadow_region_array; + + // This Monitor provides mutual exclusive access of _shadow_region_array + static Monitor* _shadow_region_monitor; + Action _action; HeapWord* _last_query_beg; @@ -109,6 +119,14 @@ // marking stack and overflow stack directly. public: + static size_t acquire_shadow_region(PSParallelCompact::RegionData* region_ptr); + static void release_shadow_region(size_t shadow_region); + static void enqueue_shadow_region(size_t shadow_region); + static void dequeue_shadow_region(); + inline size_t shadow_record() { return _shadow_record; } + inline void set_shadow_record(size_t record) { _shadow_record = record; } + inline size_t next_shadow_record(size_t workers) { _shadow_record += workers; return shadow_record(); } + void reset_bitmap_query_cache() { _last_query_beg = NULL; _last_query_obj = NULL;