< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp

Print this page
rev 53870 : imported patch shade-shenandoah-ptrqueue


 163 
 164   _regions = NEW_C_HEAP_ARRAY(ShenandoahHeapRegion*, _num_regions, mtGC);
 165   _free_set = new ShenandoahFreeSet(this, _num_regions);
 166 
 167   _collection_set = new ShenandoahCollectionSet(this, (HeapWord*)pgc_rs.base());
 168 
 169   if (ShenandoahPacing) {
 170     _pacer = new ShenandoahPacer(this);
 171     _pacer->setup_for_idle();
 172   } else {
 173     _pacer = NULL;
 174   }
 175 
 176   assert((((size_t) base()) & ShenandoahHeapRegion::region_size_bytes_mask()) == 0,
 177          "misaligned heap: " PTR_FORMAT, p2i(base()));
 178 
 179   // The call below uses stuff (the SATB* things) that are in G1, but probably
 180   // belong into a shared location.
 181   ShenandoahBarrierSet::satb_mark_queue_set().initialize(this,
 182                                                SATB_Q_CBL_mon,
 183                                                20 /*G1SATBProcessCompletedThreshold */,
 184                                                60 /* G1SATBBufferEnqueueingThresholdPercent */,
 185                                                Shared_SATB_Q_lock);
 186 
 187   // Reserve space for prev and next bitmap.
 188   size_t bitmap_page_size = UseLargePages ? (size_t)os::large_page_size() : (size_t)os::vm_page_size();
 189   _bitmap_size = MarkBitMap::compute_size(heap_rs.size());
 190   _bitmap_size = align_up(_bitmap_size, bitmap_page_size);
 191   _heap_region = MemRegion((HeapWord*) heap_rs.base(), heap_rs.size() / HeapWordSize);
 192 
 193   size_t bitmap_bytes_per_region = reg_size_bytes / MarkBitMap::heap_map_factor();
 194 
 195   guarantee(bitmap_bytes_per_region != 0,
 196             "Bitmap bytes per region should not be zero");
 197   guarantee(is_power_of_2(bitmap_bytes_per_region),
 198             "Bitmap bytes per region should be power of two: " SIZE_FORMAT, bitmap_bytes_per_region);
 199 
 200   if (bitmap_page_size > bitmap_bytes_per_region) {
 201     _bitmap_regions_per_slice = bitmap_page_size / bitmap_bytes_per_region;
 202     _bitmap_bytes_per_slice = bitmap_page_size;
 203   } else {
 204     _bitmap_regions_per_slice = 1;
 205     _bitmap_bytes_per_slice = bitmap_bytes_per_region;




 163 
 164   _regions = NEW_C_HEAP_ARRAY(ShenandoahHeapRegion*, _num_regions, mtGC);
 165   _free_set = new ShenandoahFreeSet(this, _num_regions);
 166 
 167   _collection_set = new ShenandoahCollectionSet(this, (HeapWord*)pgc_rs.base());
 168 
 169   if (ShenandoahPacing) {
 170     _pacer = new ShenandoahPacer(this);
 171     _pacer->setup_for_idle();
 172   } else {
 173     _pacer = NULL;
 174   }
 175 
 176   assert((((size_t) base()) & ShenandoahHeapRegion::region_size_bytes_mask()) == 0,
 177          "misaligned heap: " PTR_FORMAT, p2i(base()));
 178 
 179   // The call below uses stuff (the SATB* things) that are in G1, but probably
 180   // belong into a shared location.
 181   ShenandoahBarrierSet::satb_mark_queue_set().initialize(this,
 182                                                SATB_Q_CBL_mon,
 183                                                20 /* G1SATBProcessCompletedThreshold */,
 184                                                60 /* G1SATBBufferEnqueueingThresholdPercent */);

 185 
 186   // Reserve space for prev and next bitmap.
 187   size_t bitmap_page_size = UseLargePages ? (size_t)os::large_page_size() : (size_t)os::vm_page_size();
 188   _bitmap_size = MarkBitMap::compute_size(heap_rs.size());
 189   _bitmap_size = align_up(_bitmap_size, bitmap_page_size);
 190   _heap_region = MemRegion((HeapWord*) heap_rs.base(), heap_rs.size() / HeapWordSize);
 191 
 192   size_t bitmap_bytes_per_region = reg_size_bytes / MarkBitMap::heap_map_factor();
 193 
 194   guarantee(bitmap_bytes_per_region != 0,
 195             "Bitmap bytes per region should not be zero");
 196   guarantee(is_power_of_2(bitmap_bytes_per_region),
 197             "Bitmap bytes per region should be power of two: " SIZE_FORMAT, bitmap_bytes_per_region);
 198 
 199   if (bitmap_page_size > bitmap_bytes_per_region) {
 200     _bitmap_regions_per_slice = bitmap_page_size / bitmap_bytes_per_region;
 201     _bitmap_bytes_per_slice = bitmap_page_size;
 202   } else {
 203     _bitmap_regions_per_slice = 1;
 204     _bitmap_bytes_per_slice = bitmap_bytes_per_region;


< prev index next >