src/share/vm/gc_implementation/parNew/parNewGeneration.cpp

Print this page
rev 7653 : 8068883: Remove disabling of warning "C4355: 'this' : used in base member initializer list"

@@ -55,14 +55,10 @@
 #include "utilities/globalDefinitions.hpp"
 #include "utilities/workgroup.hpp"
 
 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
 
-#ifdef _MSC_VER
-#pragma warning( push )
-#pragma warning( disable:4355 ) // 'this' : used in base member initializer list
-#endif
 ParScanThreadState::ParScanThreadState(Space* to_space_,
                                        ParNewGeneration* gen_,
                                        Generation* old_gen_,
                                        int thread_num_,
                                        ObjToScanQueueSet* work_queue_set_,

@@ -72,20 +68,31 @@
   _to_space(to_space_), _old_gen(old_gen_), _young_gen(gen_), _thread_num(thread_num_),
   _work_queue(work_queue_set_->queue(thread_num_)), _to_space_full(false),
   _overflow_stack(overflow_stacks_ ? overflow_stacks_ + thread_num_ : NULL),
   _ageTable(false), // false ==> not the global age table, no perf data.
   _to_space_alloc_buffer(desired_plab_sz_),
-  _to_space_closure(gen_, this), _old_gen_closure(gen_, this),
-  _to_space_root_closure(gen_, this), _old_gen_root_closure(gen_, this),
-  _older_gen_closure(gen_, this),
-  _evacuate_followers(this, &_to_space_closure, &_old_gen_closure,
-                      &_to_space_root_closure, gen_, &_old_gen_root_closure,
-                      work_queue_set_, &term_),
-  _is_alive_closure(gen_), _scan_weak_ref_closure(gen_, this),
+  _is_alive_closure(gen_),
   _keep_alive_closure(&_scan_weak_ref_closure),
   _strong_roots_time(0.0), _term_time(0.0)
 {
+  _to_space_closure = ParScanWithoutBarrierClosure(gen_, this);
+  _old_gen_closure = ParScanWithBarrierClosure(gen_, this);
+  _to_space_root_closure = ParRootScanWithoutBarrierClosure(gen_, this);
+  _old_gen_root_closure = ParRootScanWithBarrierTwoGensClosure(gen_, this);
+  _older_gen_closure = ParRootScanWithBarrierTwoGensClosure(gen_, this);
+  _scan_weak_ref_closure = ParScanWeakRefClosure(gen_, this);
+
+  _evacuate_followers = ParEvacuateFollowersClosure(this,
+                                                    &_to_space_closure,
+                                                    &_old_gen_closure,
+                                                    &_to_space_root_closure,
+                                                    gen_,
+                                                    &_old_gen_root_closure,
+                                                    work_queue_set_,
+                                                    &term_);
+
+
   #if TASKQUEUE_STATS
   _term_attempts = 0;
   _overflow_refills = 0;
   _overflow_refill_objs = 0;
   #endif // TASKQUEUE_STATS

@@ -95,13 +102,10 @@
   _hash_seed = 17;  // Might want to take time-based random value.
   _start = os::elapsedTime();
   _old_gen_closure.set_generation(old_gen_);
   _old_gen_root_closure.set_generation(old_gen_);
 }
-#ifdef _MSC_VER
-#pragma warning( pop )
-#endif
 
 void ParScanThreadState::record_survivor_plab(HeapWord* plab_start,
                                               size_t plab_word_size) {
   ChunkArray* sca = survivor_chunk_array();
   if (sca != NULL) {

@@ -514,14 +518,10 @@
 {}
 
 void ParScanWeakRefClosure::do_oop(oop* p)       { ParScanWeakRefClosure::do_oop_work(p); }
 void ParScanWeakRefClosure::do_oop(narrowOop* p) { ParScanWeakRefClosure::do_oop_work(p); }
 
-#ifdef WIN32
-#pragma warning(disable: 4786) /* identifier was truncated to '255' characters in the browser information */
-#endif
-
 ParEvacuateFollowersClosure::ParEvacuateFollowersClosure(
     ParScanThreadState* par_scan_state_,
     ParScanWithoutBarrierClosure* to_space_closure_,
     ParScanWithBarrierClosure* old_gen_closure_,
     ParRootScanWithoutBarrierClosure* to_space_root_closure_,

@@ -632,21 +632,17 @@
 
   // "evacuate followers".
   par_scan_state.evacuate_followers_closure().do_void();
 }
 
-#ifdef _MSC_VER
-#pragma warning( push )
-#pragma warning( disable:4355 ) // 'this' : used in base member initializer list
-#endif
 ParNewGeneration::
 ParNewGeneration(ReservedSpace rs, size_t initial_byte_size, int level)
   : DefNewGeneration(rs, initial_byte_size, level, "PCopy"),
   _overflow_list(NULL),
-  _is_alive_closure(this),
   _plab_stats(YoungPLABSize, PLABWeight)
 {
+  _is_alive_closure = DefNewGeneration::IsAliveClosure(this);
   NOT_PRODUCT(_overflow_counter = ParGCWorkQueueOverflowInterval;)
   NOT_PRODUCT(_num_par_pushes = 0;)
   _task_queues = new ObjToScanQueueSet(ParallelGCThreads);
   guarantee(_task_queues != NULL, "task_queues allocation failure.");
 

@@ -680,13 +676,10 @@
          PerfDataManager::counter_name(_gen_counters->name_space(), "threads");
     PerfDataManager::create_constant(SUN_GC, cname, PerfData::U_None,
                                      ParallelGCThreads, CHECK);
   }
 }
-#ifdef _MSC_VER
-#pragma warning( pop )
-#endif
 
 // ParNewGeneration::
 ParKeepAliveClosure::ParKeepAliveClosure(ParScanWeakRefClosure* cl) :
   DefNewGeneration::KeepAliveClosure(cl), _par_cl(cl) {}