Print this page


Split Close
Expand all
Collapse all
          --- old/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
          +++ new/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
↓ open down ↓ 284 lines elided ↑ open up ↑
 285  285  }
 286  286  
 287  287  void ConcurrentMarkSweepGeneration::ref_processor_init() {
 288  288    assert(collector() != NULL, "no collector");
 289  289    collector()->ref_processor_init();
 290  290  }
 291  291  
 292  292  void CMSCollector::ref_processor_init() {
 293  293    if (_ref_processor == NULL) {
 294  294      // Allocate and initialize a reference processor
 295      -    _ref_processor = ReferenceProcessor::create_ref_processor(
 296      -        _span,                               // span
 297      -        _cmsGen->refs_discovery_is_atomic(), // atomic_discovery
 298      -        _cmsGen->refs_discovery_is_mt(),     // mt_discovery
 299      -        &_is_alive_closure,
 300      -        ParallelGCThreads,
 301      -        ParallelRefProcEnabled);
      295 +    _ref_processor =
      296 +      new ReferenceProcessor(_span,                               // span
      297 +                             (ParallelGCThreads > 1) && ParallelRefProcEnabled, // mt processing
      298 +                             ParallelGCThreads,                   // mt processing degree
      299 +                             _cmsGen->refs_discovery_is_mt(),     // mt discovery
      300 +                             ConcGCThreads,                       // mt discovery degree
      301 +                             _cmsGen->refs_discovery_is_atomic(), // discovery is not atomic
      302 +                             &_is_alive_closure,                  // closure for liveness info
      303 +                             false);                              // next field updates do not need write barrier
 302  304      // Initialize the _ref_processor field of CMSGen
 303  305      _cmsGen->set_ref_processor(_ref_processor);
 304  306  
 305  307      // Allocate a dummy ref processor for perm gen.
 306  308      ReferenceProcessor* rp2 = new ReferenceProcessor();
 307  309      if (rp2 == NULL) {
 308  310        vm_exit_during_initialization("Could not allocate ReferenceProcessor object");
 309  311      }
 310  312      _permGen->set_ref_processor(rp2);
 311  313    }
↓ open down ↓ 5384 lines elided ↑ open up ↑
5696 5698    const MemRegion        _span;
5697 5699    ProcessTask&           _task;
5698 5700  
5699 5701  public:
5700 5702    CMSRefProcTaskProxy(ProcessTask&     task,
5701 5703                        CMSCollector*    collector,
5702 5704                        const MemRegion& span,
5703 5705                        CMSBitMap*       mark_bit_map,
5704 5706                        AbstractWorkGang* workers,
5705 5707                        OopTaskQueueSet* task_queues):
     5708 +    // XXX Should superclass AGTWOQ also know about AWG since it knows
     5709 +    // about the task_queues used by the AWG? Then it could initialize
     5710 +    // the terminator() object. See 6984287. The set_for_termination()
     5711 +    // below is a temporary band-aid for the regression in 6984287.
5706 5712      AbstractGangTaskWOopQueues("Process referents by policy in parallel",
5707 5713        task_queues),
5708 5714      _task(task),
5709 5715      _collector(collector), _span(span), _mark_bit_map(mark_bit_map)
5710      -    {
5711      -      assert(_collector->_span.equals(_span) && !_span.is_empty(),
5712      -             "Inconsistency in _span");
5713      -    }
     5716 +  {
     5717 +    assert(_collector->_span.equals(_span) && !_span.is_empty(),
     5718 +           "Inconsistency in _span");
     5719 +    set_for_termination(workers->active_workers());
     5720 +  }
5714 5721  
5715 5722    OopTaskQueueSet* task_queues() { return queues(); }
5716 5723  
5717 5724    OopTaskQueue* work_queue(int i) { return task_queues()->queue(i); }
5718 5725  
5719 5726    void do_work_steal(int i,
5720 5727                       CMSParDrainMarkingStackClosure* drain,
5721 5728                       CMSParKeepAliveClosure* keep_alive,
5722 5729                       int* seed);
5723 5730  
↓ open down ↓ 3553 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX