< prev index next >

src/hotspot/share/gc/g1/heapRegion.cpp

Print this page




  95   guarantee(GrainBytes == 0, "we should only set it once");
  96   // The cast to int is safe, given that we've bounded region_size by
  97   // MIN_REGION_SIZE and MAX_REGION_SIZE.
  98   GrainBytes = region_size;
  99   log_info(gc, heap)("Heap region size: " SIZE_FORMAT "M", GrainBytes / M);
 100 
 101   guarantee(GrainWords == 0, "we should only set it once");
 102   GrainWords = GrainBytes >> LogHeapWordSize;
 103   guarantee((size_t) 1 << LogOfHRGrainWords == GrainWords, "sanity");
 104 
 105   guarantee(CardsPerRegion == 0, "we should only set it once");
 106   CardsPerRegion = GrainBytes >> G1CardTable::card_shift;
 107 
 108   LogCardsPerRegion = log2_long((jlong) CardsPerRegion);
 109 
 110   if (G1HeapRegionSize != GrainBytes) {
 111     FLAG_SET_ERGO(G1HeapRegionSize, GrainBytes);
 112   }
 113 }
 114 













 115 void HeapRegion::hr_clear(bool keep_remset, bool clear_space, bool locked) {
 116   assert(_humongous_start_region == NULL,
 117          "we should have already filtered out humongous regions");
 118   assert(!in_collection_set(),
 119          "Should not clear heap region %u in the collection set", hrm_index());
 120 
 121   clear_young_index_in_cset();
 122   clear_index_in_opt_cset();
 123   uninstall_surv_rate_group();
 124   set_free();
 125   reset_pre_dummy_top();
 126 
 127   if (!keep_remset) {
 128     if (locked) {
 129       rem_set()->clear_locked();
 130     } else {
 131       rem_set()->clear();
 132     }
 133   }
 134 




  95   guarantee(GrainBytes == 0, "we should only set it once");
  96   // The cast to int is safe, given that we've bounded region_size by
  97   // MIN_REGION_SIZE and MAX_REGION_SIZE.
  98   GrainBytes = region_size;
  99   log_info(gc, heap)("Heap region size: " SIZE_FORMAT "M", GrainBytes / M);
 100 
 101   guarantee(GrainWords == 0, "we should only set it once");
 102   GrainWords = GrainBytes >> LogHeapWordSize;
 103   guarantee((size_t) 1 << LogOfHRGrainWords == GrainWords, "sanity");
 104 
 105   guarantee(CardsPerRegion == 0, "we should only set it once");
 106   CardsPerRegion = GrainBytes >> G1CardTable::card_shift;
 107 
 108   LogCardsPerRegion = log2_long((jlong) CardsPerRegion);
 109 
 110   if (G1HeapRegionSize != GrainBytes) {
 111     FLAG_SET_ERGO(G1HeapRegionSize, GrainBytes);
 112   }
 113 }
 114 
 115 void HeapRegion::handle_evacuation_failed() {
 116   uninstall_surv_rate_group();
 117   clear_young_index_in_cset();
 118   set_evacuation_failed(false);
 119   set_old();
 120 }
 121 
 122 void HeapRegion::unlink_from_list() {
 123   set_next(NULL);
 124   set_prev(NULL);
 125   set_containing_set(NULL);
 126 }
 127 
 128 void HeapRegion::hr_clear(bool keep_remset, bool clear_space, bool locked) {
 129   assert(_humongous_start_region == NULL,
 130          "we should have already filtered out humongous regions");
 131   assert(!in_collection_set(),
 132          "Should not clear heap region %u in the collection set", hrm_index());
 133 
 134   clear_young_index_in_cset();
 135   clear_index_in_opt_cset();
 136   uninstall_surv_rate_group();
 137   set_free();
 138   reset_pre_dummy_top();
 139 
 140   if (!keep_remset) {
 141     if (locked) {
 142       rem_set()->clear_locked();
 143     } else {
 144       rem_set()->clear();
 145     }
 146   }
 147 


< prev index next >