src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp

changeset 578
b5489bb705c9
parent 548
ba764ed4b6f2
child 622
790e66e5fbac
child 777
37f87013dfd8
     1.1 --- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	Sun May 04 03:29:31 2008 -0700
     1.2 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	Tue May 06 15:37:36 2008 -0700
     1.3 @@ -520,7 +520,10 @@
     1.4                   -1 /* lock-free */, "No_lock" /* dummy */),
     1.5    _modUnionClosure(&_modUnionTable),
     1.6    _modUnionClosurePar(&_modUnionTable),
     1.7 -  _is_alive_closure(&_markBitMap),
     1.8 +  // Adjust my span to cover old (cms) gen and perm gen
     1.9 +  _span(cmsGen->reserved()._union(permGen->reserved())),
    1.10 +  // Construct the is_alive_closure with _span & markBitMap
    1.11 +  _is_alive_closure(_span, &_markBitMap),
    1.12    _restart_addr(NULL),
    1.13    _overflow_list(NULL),
    1.14    _preserved_oop_stack(NULL),
    1.15 @@ -572,11 +575,6 @@
    1.16    _cmsGen->cmsSpace()->set_collector(this);
    1.17    _permGen->cmsSpace()->set_collector(this);
    1.18  
    1.19 -  // Adjust my span to cover old (cms) gen and perm gen
    1.20 -  _span = _cmsGen->reserved()._union(_permGen->reserved());
    1.21 -  // Initialize the span of is_alive_closure
    1.22 -  _is_alive_closure.set_span(_span);
    1.23 -
    1.24    // Allocate MUT and marking bit map
    1.25    {
    1.26      MutexLockerEx x(_markBitMap.lock(), Mutex::_no_safepoint_check_flag);
    1.27 @@ -5496,7 +5494,7 @@
    1.28    typedef AbstractRefProcTaskExecutor::ProcessTask ProcessTask;
    1.29    CMSCollector*          _collector;
    1.30    CMSBitMap*             _mark_bit_map;
    1.31 -  MemRegion              _span;
    1.32 +  const MemRegion        _span;
    1.33    OopTaskQueueSet*       _task_queues;
    1.34    ParallelTaskTerminator _term;
    1.35    ProcessTask&           _task;
    1.36 @@ -5513,7 +5511,10 @@
    1.37      _collector(collector), _span(span), _mark_bit_map(mark_bit_map),
    1.38      _task_queues(task_queues),
    1.39      _term(total_workers, task_queues)
    1.40 -    { }
    1.41 +    {
    1.42 +      assert(_collector->_span.equals(_span) && !_span.is_empty(),
    1.43 +             "Inconsistency in _span");
    1.44 +    }
    1.45  
    1.46    OopTaskQueueSet* task_queues() { return _task_queues; }
    1.47  
    1.48 @@ -5530,11 +5531,12 @@
    1.49  };
    1.50  
    1.51  void CMSRefProcTaskProxy::work(int i) {
    1.52 +  assert(_collector->_span.equals(_span), "Inconsistency in _span");
    1.53    CMSParKeepAliveClosure par_keep_alive(_collector, _span,
    1.54                                          _mark_bit_map, work_queue(i));
    1.55    CMSParDrainMarkingStackClosure par_drain_stack(_collector, _span,
    1.56                                                   _mark_bit_map, work_queue(i));
    1.57 -  CMSIsAliveClosure is_alive_closure(_mark_bit_map);
    1.58 +  CMSIsAliveClosure is_alive_closure(_span, _mark_bit_map);
    1.59    _task.work(i, is_alive_closure, par_keep_alive, par_drain_stack);
    1.60    if (_task.marks_oops_alive()) {
    1.61      do_work_steal(i, &par_drain_stack, &par_keep_alive,

mercurial