src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp

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

@@ -1751,22 +1751,15 @@
   verify_region_sets_optional();
 }
 
 // Public methods.
 
-#ifdef _MSC_VER // the use of 'this' below gets a warning, make it go away
-#pragma warning( disable:4355 ) // 'this' : used in base member initializer list
-#endif // _MSC_VER
-
-
 G1CollectedHeap::G1CollectedHeap(G1CollectorPolicy* policy_) :
   SharedHeap(policy_),
   _g1_policy(policy_),
   _dirty_card_queue_set(false),
   _into_cset_dirty_card_queue_set(false),
-  _is_alive_closure_cm(this),
-  _is_alive_closure_stw(this),
   _ref_processor_cm(NULL),
   _ref_processor_stw(NULL),
   _process_strong_tasks(new SubTasksDone(G1H_PS_NumElements)),
   _bot_shared(NULL),
   _evac_failure_scan_stack(NULL),

@@ -1779,11 +1772,10 @@
   _old_set("Old Set", false /* humongous */, new OldRegionSetMtSafeChecker()),
   _humongous_set("Master Humongous Set", true /* humongous */, new HumongousRegionSetMtSafeChecker()),
   _humongous_is_live(),
   _has_humongous_reclaim_candidates(false),
   _free_regions_coming(false),
-  _young_list(new YoungList(this)),
   _gc_time_stamp(0),
   _survivor_plab_stats(YoungPLABSize, PLABWeight),
   _old_plab_stats(OldPLABSize, PLABWeight),
   _expand_heap_after_alloc_failure(true),
   _surviving_young_words(NULL),

@@ -1798,11 +1790,15 @@
   _gc_timer_stw(new (ResourceObj::C_HEAP, mtGC) STWGCTimer()),
   _gc_timer_cm(new (ResourceObj::C_HEAP, mtGC) ConcurrentGCTimer()),
   _gc_tracer_stw(new (ResourceObj::C_HEAP, mtGC) G1NewTracer()),
   _gc_tracer_cm(new (ResourceObj::C_HEAP, mtGC) G1OldTracer()) {
 
+  _is_alive_closure_cm = G1CMIsAliveClosure(this);
+  _is_alive_closure_stw = G1STWIsAliveClosure(this);
+  _young_list = new YoungList(this);
   _g1h = this;
+
   if (_process_strong_tasks == NULL || !_process_strong_tasks->valid()) {
     vm_exit_during_initialization("Failed necessary allocation.");
   }
 
   _allocator = G1Allocator::create_allocator(_g1h);