changeset 58011:c8a3d5ca8312

8238160: Uniformize Parallel GC task queue variable names Reviewed-by: kbarrett, sangheki
author tschatzl
date Tue, 11 Feb 2020 12:48:25 +0100
parents 8e6fa89397ca
children 698732b81e94
files src/hotspot/share/gc/parallel/psCompactionManager.cpp src/hotspot/share/gc/parallel/psCompactionManager.hpp src/hotspot/share/gc/parallel/psCompactionManager.inline.hpp src/hotspot/share/gc/parallel/psParallelCompact.cpp src/hotspot/share/gc/parallel/psPromotionManager.cpp src/hotspot/share/gc/parallel/psPromotionManager.hpp src/hotspot/share/gc/shared/taskqueue.hpp
diffstat 7 files changed, 37 insertions(+), 38 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/gc/parallel/psCompactionManager.cpp	Wed Feb 05 17:14:15 2020 +0800
+++ b/src/hotspot/share/gc/parallel/psCompactionManager.cpp	Tue Feb 11 12:48:25 2020 +0100
@@ -40,15 +40,15 @@
 #include "oops/objArrayKlass.inline.hpp"
 #include "oops/oop.inline.hpp"
 
-PSOldGen*            ParCompactionManager::_old_gen = NULL;
+PSOldGen*               ParCompactionManager::_old_gen = NULL;
 ParCompactionManager**  ParCompactionManager::_manager_array = NULL;
 
-OopTaskQueueSet*     ParCompactionManager::_stack_array = NULL;
-ParCompactionManager::ObjArrayTaskQueueSet*
-  ParCompactionManager::_objarray_queues = NULL;
+ParCompactionManager::OopTaskQueueSet*      ParCompactionManager::_oop_task_queues = NULL;
+ParCompactionManager::ObjArrayTaskQueueSet* ParCompactionManager::_objarray_task_queues = NULL;
+ParCompactionManager::RegionTaskQueueSet*   ParCompactionManager::_region_task_queues = NULL;
+
 ObjectStartArray*    ParCompactionManager::_start_array = NULL;
 ParMarkBitMap*       ParCompactionManager::_mark_bitmap = NULL;
-RegionTaskQueueSet*  ParCompactionManager::_region_array = NULL;
 GrowableArray<size_t >* ParCompactionManager::_shadow_region_array = NULL;
 Monitor*                ParCompactionManager::_shadow_region_monitor = NULL;
 
@@ -77,20 +77,20 @@
   assert(_manager_array == NULL, "Attempt to initialize twice");
   _manager_array = NEW_C_HEAP_ARRAY(ParCompactionManager*, parallel_gc_threads+1, mtGC);
 
-  _stack_array = new OopTaskQueueSet(parallel_gc_threads);
-  guarantee(_stack_array != NULL, "Could not allocate stack_array");
-  _objarray_queues = new ObjArrayTaskQueueSet(parallel_gc_threads);
-  guarantee(_objarray_queues != NULL, "Could not allocate objarray_queues");
-  _region_array = new RegionTaskQueueSet(parallel_gc_threads);
-  guarantee(_region_array != NULL, "Could not allocate region_array");
+  _oop_task_queues = new OopTaskQueueSet(parallel_gc_threads);
+  guarantee(_oop_task_queues != NULL, "Could not allocate oop task queues");
+  _objarray_task_queues = new ObjArrayTaskQueueSet(parallel_gc_threads);
+  guarantee(_objarray_task_queues != NULL, "Could not allocate objarray task queues");
+  _region_task_queues = new RegionTaskQueueSet(parallel_gc_threads);
+  guarantee(_region_task_queues != NULL, "Could not allocate region task queues");
 
   // Create and register the ParCompactionManager(s) for the worker threads.
   for(uint i=0; i<parallel_gc_threads; i++) {
     _manager_array[i] = new ParCompactionManager();
     guarantee(_manager_array[i] != NULL, "Could not create ParCompactionManager");
-    stack_array()->register_queue(i, _manager_array[i]->marking_stack());
-    _objarray_queues->register_queue(i, &_manager_array[i]->_objarray_stack);
-    region_array()->register_queue(i, _manager_array[i]->region_stack());
+    oop_task_queues()->register_queue(i, _manager_array[i]->marking_stack());
+    _objarray_task_queues->register_queue(i, &_manager_array[i]->_objarray_stack);
+    region_task_queues()->register_queue(i, _manager_array[i]->region_stack());
   }
 
   // The VMThread gets its own ParCompactionManager, which is not available
--- a/src/hotspot/share/gc/parallel/psCompactionManager.hpp	Wed Feb 05 17:14:15 2020 +0800
+++ b/src/hotspot/share/gc/parallel/psCompactionManager.hpp	Tue Feb 11 12:48:25 2020 +0100
@@ -51,17 +51,22 @@
 
 
  private:
+  typedef GenericTaskQueue<oop, mtGC>             OopTaskQueue;
+  typedef GenericTaskQueueSet<OopTaskQueue, mtGC> OopTaskQueueSet;
+
   // 32-bit:  4K * 8 = 32KiB; 64-bit:  8K * 16 = 128KiB
   #define QUEUE_SIZE (1 << NOT_LP64(12) LP64_ONLY(13))
   typedef OverflowTaskQueue<ObjArrayTask, mtGC, QUEUE_SIZE> ObjArrayTaskQueue;
   typedef GenericTaskQueueSet<ObjArrayTaskQueue, mtGC>      ObjArrayTaskQueueSet;
   #undef QUEUE_SIZE
+  typedef OverflowTaskQueue<size_t, mtGC>             RegionTaskQueue;
+  typedef GenericTaskQueueSet<RegionTaskQueue, mtGC>  RegionTaskQueueSet;
 
   static ParCompactionManager** _manager_array;
-  static OopTaskQueueSet*       _stack_array;
-  static ObjArrayTaskQueueSet*  _objarray_queues;
+  static OopTaskQueueSet*       _oop_task_queues;
+  static ObjArrayTaskQueueSet*  _objarray_task_queues;
   static ObjectStartArray*      _start_array;
-  static RegionTaskQueueSet*    _region_array;
+  static RegionTaskQueueSet*    _region_task_queues;
   static PSOldGen*              _old_gen;
 
 private:
@@ -90,13 +95,13 @@
 
   static PSOldGen* old_gen()             { return _old_gen; }
   static ObjectStartArray* start_array() { return _start_array; }
-  static OopTaskQueueSet* stack_array()  { return _stack_array; }
+  static OopTaskQueueSet* oop_task_queues()  { return _oop_task_queues; }
 
   static void initialize(ParMarkBitMap* mbm);
 
  protected:
   // Array of task queues.  Needed by the task terminator.
-  static RegionTaskQueueSet* region_array()      { return _region_array; }
+  static RegionTaskQueueSet* region_task_queues()      { return _region_task_queues; }
   OverflowTaskQueue<oop, mtGC>*  marking_stack()       { return &_marking_stack; }
 
   // Pushes onto the marking stack.  If the marking stack is full,
--- a/src/hotspot/share/gc/parallel/psCompactionManager.inline.hpp	Wed Feb 05 17:14:15 2020 +0800
+++ b/src/hotspot/share/gc/parallel/psCompactionManager.inline.hpp	Tue Feb 11 12:48:25 2020 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2020, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -70,15 +70,15 @@
 };
 
 inline bool ParCompactionManager::steal(int queue_num, oop& t) {
-  return stack_array()->steal(queue_num, t);
+  return oop_task_queues()->steal(queue_num, t);
 }
 
 inline bool ParCompactionManager::steal_objarray(int queue_num, ObjArrayTask& t) {
-  return _objarray_queues->steal(queue_num, t);
+  return _objarray_task_queues->steal(queue_num, t);
 }
 
 inline bool ParCompactionManager::steal(int queue_num, size_t& region) {
-  return region_array()->steal(queue_num, region);
+  return region_task_queues()->steal(queue_num, region);
 }
 
 inline void ParCompactionManager::push(oop obj) {
--- a/src/hotspot/share/gc/parallel/psParallelCompact.cpp	Wed Feb 05 17:14:15 2020 +0800
+++ b/src/hotspot/share/gc/parallel/psParallelCompact.cpp	Tue Feb 11 12:48:25 2020 +0100
@@ -2178,7 +2178,7 @@
       AbstractGangTask("MarkFromRootsTask"),
       _strong_roots_scope(active_workers),
       _subtasks(),
-      _terminator(active_workers, ParCompactionManager::stack_array()),
+      _terminator(active_workers, ParCompactionManager::oop_task_queues()),
       _active_workers(active_workers) {
     _subtasks.set_n_threads(active_workers);
     _subtasks.set_n_tasks(ParallelRootType::sentinel);
@@ -2210,7 +2210,7 @@
       AbstractGangTask("PCRefProcTask"),
       _task(task),
       _ergo_workers(ergo_workers),
-      _terminator(_ergo_workers, ParCompactionManager::stack_array()) {
+      _terminator(_ergo_workers, ParCompactionManager::oop_task_queues()) {
   }
 
   virtual void work(uint worker_id) {
@@ -2626,7 +2626,7 @@
   UpdateDensePrefixAndCompactionTask(TaskQueue& tq, uint active_workers) :
       AbstractGangTask("UpdateDensePrefixAndCompactionTask"),
       _tq(tq),
-      _terminator(active_workers, ParCompactionManager::region_array()),
+      _terminator(active_workers, ParCompactionManager::region_task_queues()),
       _active_workers(active_workers) {
   }
   virtual void work(uint worker_id) {
--- a/src/hotspot/share/gc/parallel/psPromotionManager.cpp	Wed Feb 05 17:14:15 2020 +0800
+++ b/src/hotspot/share/gc/parallel/psPromotionManager.cpp	Tue Feb 11 12:48:25 2020 +0100
@@ -43,7 +43,7 @@
 #include "oops/compressedOops.inline.hpp"
 
 PaddedEnd<PSPromotionManager>* PSPromotionManager::_manager_array = NULL;
-OopStarTaskQueueSet*           PSPromotionManager::_stack_array_depth = NULL;
+PSPromotionManager::OopStarTaskQueueSet* PSPromotionManager::_stack_array_depth = NULL;
 PreservedMarksSet*             PSPromotionManager::_preserved_marks_set = NULL;
 PSOldGen*                      PSPromotionManager::_old_gen = NULL;
 MutableSpace*                  PSPromotionManager::_young_space = NULL;
--- a/src/hotspot/share/gc/parallel/psPromotionManager.hpp	Wed Feb 05 17:14:15 2020 +0800
+++ b/src/hotspot/share/gc/parallel/psPromotionManager.hpp	Tue Feb 11 12:48:25 2020 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -56,6 +56,9 @@
   friend class PSRefProcTask;
 
  private:
+  typedef OverflowTaskQueue<StarTask, mtGC>           OopStarTaskQueue;
+  typedef GenericTaskQueueSet<OopStarTaskQueue, mtGC> OopStarTaskQueueSet;
+
   static PaddedEnd<PSPromotionManager>* _manager_array;
   static OopStarTaskQueueSet*           _stack_array_depth;
   static PreservedMarksSet*             _preserved_marks_set;
--- a/src/hotspot/share/gc/shared/taskqueue.hpp	Wed Feb 05 17:14:15 2020 +0800
+++ b/src/hotspot/share/gc/shared/taskqueue.hpp	Tue Feb 11 12:48:25 2020 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -443,9 +443,6 @@
   virtual bool should_exit_termination() = 0;
 };
 
-typedef GenericTaskQueue<oop, mtGC>             OopTaskQueue;
-typedef GenericTaskQueueSet<OopTaskQueue, mtGC> OopTaskQueueSet;
-
 #ifdef _MSC_VER
 #pragma warning(push)
 // warning C4522: multiple assignment operators specified
@@ -524,10 +521,4 @@
 #pragma warning(pop)
 #endif
 
-typedef OverflowTaskQueue<StarTask, mtGC>           OopStarTaskQueue;
-typedef GenericTaskQueueSet<OopStarTaskQueue, mtGC> OopStarTaskQueueSet;
-
-typedef OverflowTaskQueue<size_t, mtGC>             RegionTaskQueue;
-typedef GenericTaskQueueSet<RegionTaskQueue, mtGC>  RegionTaskQueueSet;
-
 #endif // SHARE_GC_SHARED_TASKQUEUE_HPP