< prev index next >

src/hotspot/share/gc/parallel/psCompactionManager.cpp

Print this page
rev 58017 : [mq]: 8238854-remove-superfluous-alloc-checks


  61 
  62   marking_stack()->initialize();
  63   _objarray_stack.initialize();
  64   _region_stack.initialize();
  65 
  66   reset_bitmap_query_cache();
  67 }
  68 
  69 void ParCompactionManager::initialize(ParMarkBitMap* mbm) {
  70   assert(ParallelScavengeHeap::heap() != NULL,
  71     "Needed for initialization");
  72 
  73   _mark_bitmap = mbm;
  74 
  75   uint parallel_gc_threads = ParallelScavengeHeap::heap()->workers().total_workers();
  76 
  77   assert(_manager_array == NULL, "Attempt to initialize twice");
  78   _manager_array = NEW_C_HEAP_ARRAY(ParCompactionManager*, parallel_gc_threads+1, mtGC);
  79 
  80   _oop_task_queues = new OopTaskQueueSet(parallel_gc_threads);
  81   guarantee(_oop_task_queues != NULL, "Could not allocate oop task queues");
  82   _objarray_task_queues = new ObjArrayTaskQueueSet(parallel_gc_threads);
  83   guarantee(_objarray_task_queues != NULL, "Could not allocate objarray task queues");
  84   _region_task_queues = new RegionTaskQueueSet(parallel_gc_threads);
  85   guarantee(_region_task_queues != NULL, "Could not allocate region task queues");
  86 
  87   // Create and register the ParCompactionManager(s) for the worker threads.
  88   for(uint i=0; i<parallel_gc_threads; i++) {
  89     _manager_array[i] = new ParCompactionManager();
  90     guarantee(_manager_array[i] != NULL, "Could not create ParCompactionManager");
  91     oop_task_queues()->register_queue(i, _manager_array[i]->marking_stack());
  92     _objarray_task_queues->register_queue(i, &_manager_array[i]->_objarray_stack);
  93     region_task_queues()->register_queue(i, _manager_array[i]->region_stack());
  94   }
  95 
  96   // The VMThread gets its own ParCompactionManager, which is not available
  97   // for work stealing.
  98   _manager_array[parallel_gc_threads] = new ParCompactionManager();
  99   guarantee(_manager_array[parallel_gc_threads] != NULL,
 100     "Could not create ParCompactionManager");
 101   assert(ParallelScavengeHeap::heap()->workers().total_workers() != 0,
 102     "Not initialized?");
 103 
 104   _shadow_region_array = new (ResourceObj::C_HEAP, mtInternal) GrowableArray<size_t >(10, true);
 105 
 106   _shadow_region_monitor = new Monitor(Mutex::barrier, "CompactionManager monitor",
 107                                        Mutex::_allow_vm_block_flag, Monitor::_safepoint_check_never);
 108 }
 109 
 110 void ParCompactionManager::reset_all_bitmap_query_caches() {
 111   uint parallel_gc_threads = ParallelScavengeHeap::heap()->workers().total_workers();
 112   for (uint i=0; i<=parallel_gc_threads; i++) {
 113     _manager_array[i]->reset_bitmap_query_cache();
 114   }
 115 }
 116 
 117 
 118 ParCompactionManager*
 119 ParCompactionManager::gc_thread_compaction_manager(uint index) {
 120   assert(index < ParallelGCThreads, "index out of range");




  61 
  62   marking_stack()->initialize();
  63   _objarray_stack.initialize();
  64   _region_stack.initialize();
  65 
  66   reset_bitmap_query_cache();
  67 }
  68 
  69 void ParCompactionManager::initialize(ParMarkBitMap* mbm) {
  70   assert(ParallelScavengeHeap::heap() != NULL,
  71     "Needed for initialization");
  72 
  73   _mark_bitmap = mbm;
  74 
  75   uint parallel_gc_threads = ParallelScavengeHeap::heap()->workers().total_workers();
  76 
  77   assert(_manager_array == NULL, "Attempt to initialize twice");
  78   _manager_array = NEW_C_HEAP_ARRAY(ParCompactionManager*, parallel_gc_threads+1, mtGC);
  79 
  80   _oop_task_queues = new OopTaskQueueSet(parallel_gc_threads);

  81   _objarray_task_queues = new ObjArrayTaskQueueSet(parallel_gc_threads);

  82   _region_task_queues = new RegionTaskQueueSet(parallel_gc_threads);

  83 
  84   // Create and register the ParCompactionManager(s) for the worker threads.
  85   for(uint i=0; i<parallel_gc_threads; i++) {
  86     _manager_array[i] = new ParCompactionManager();

  87     oop_task_queues()->register_queue(i, _manager_array[i]->marking_stack());
  88     _objarray_task_queues->register_queue(i, &_manager_array[i]->_objarray_stack);
  89     region_task_queues()->register_queue(i, _manager_array[i]->region_stack());
  90   }
  91 
  92   // The VMThread gets its own ParCompactionManager, which is not available
  93   // for work stealing.
  94   _manager_array[parallel_gc_threads] = new ParCompactionManager();


  95   assert(ParallelScavengeHeap::heap()->workers().total_workers() != 0,
  96     "Not initialized?");
  97 
  98   _shadow_region_array = new (ResourceObj::C_HEAP, mtInternal) GrowableArray<size_t >(10, true);
  99 
 100   _shadow_region_monitor = new Monitor(Mutex::barrier, "CompactionManager monitor",
 101                                        Mutex::_allow_vm_block_flag, Monitor::_safepoint_check_never);
 102 }
 103 
 104 void ParCompactionManager::reset_all_bitmap_query_caches() {
 105   uint parallel_gc_threads = ParallelScavengeHeap::heap()->workers().total_workers();
 106   for (uint i=0; i<=parallel_gc_threads; i++) {
 107     _manager_array[i]->reset_bitmap_query_cache();
 108   }
 109 }
 110 
 111 
 112 ParCompactionManager*
 113 ParCompactionManager::gc_thread_compaction_manager(uint index) {
 114   assert(index < ParallelGCThreads, "index out of range");


< prev index next >