diff src/share/vm/gc_implementation/g1/g1ParScanThreadState.cpp @ 20225:cd43876f692e

8040977: G1 crashes when run with -XX:-G1DeferredRSUpdate Summary: When G1 is run with -XX:-G1DeferredRSUpdate, the VM crashes because of wrong initialization order of member variables. The change makes the initalization explicit, not relying on initialization order any more. Reviewed-by: brutisso, mgerdin
author tschatzl
date Mon, 21 Jul 2014 09:41:06 +0200
parents a2328cbebb23
children ee019285a52c
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/g1/g1ParScanThreadState.cpp	Mon Jul 21 09:41:06 2014 +0200
+++ b/src/share/vm/gc_implementation/g1/g1ParScanThreadState.cpp	Mon Jul 21 09:41:06 2014 +0200
@@ -30,10 +30,6 @@
 #include "oops/oop.pcgc.inline.hpp"
 #include "runtime/prefetch.inline.hpp"
 
-#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
-
 G1ParScanThreadState::G1ParScanThreadState(G1CollectedHeap* g1h, uint queue_num, ReferenceProcessor* rp)
   : _g1h(g1h),
     _refs(g1h->task_queue(queue_num)),
@@ -44,9 +40,10 @@
     _term_attempts(0),
     _surviving_alloc_buffer(g1h->desired_plab_sz(GCAllocForSurvived)),
     _tenured_alloc_buffer(g1h->desired_plab_sz(GCAllocForTenured)),
-    _age_table(false), _scanner(g1h, this, rp),
+    _age_table(false), _scanner(g1h, rp),
     _strong_roots_time(0), _term_time(0),
     _alloc_buffer_waste(0), _undo_waste(0) {
+  _scanner.set_par_scan_thread_state(this);
   // we allocate G1YoungSurvRateNumRegions plus one entries, since
   // we "sacrifice" entry 0 to keep track of surviving bytes for
   // non-young regions (where the age is -1)