145 GrainWords = GrainBytes >> LogHeapWordSize;
146 guarantee((size_t) 1 << LogOfHRGrainWords == GrainWords, "sanity");
147
148 guarantee(CardsPerRegion == 0, "we should only set it once");
149 CardsPerRegion = GrainBytes >> CardTableModRefBS::card_shift;
150 }
151
152 void HeapRegion::reset_after_compaction() {
153 G1OffsetTableContigSpace::reset_after_compaction();
154 // After a compaction the mark bitmap is invalid, so we must
155 // treat all objects as being inside the unmarked area.
156 zero_marked_bytes();
157 init_top_at_mark_start();
158 }
159
160 void HeapRegion::hr_clear(bool par, bool clear_space, bool locked) {
161 assert(_humongous_start_region == NULL,
162 "we should have already filtered out humongous regions");
163 assert(_end == orig_end(),
164 "we should have already filtered out humongous regions");
165
166 _in_collection_set = false;
167
168 set_allocation_context(AllocationContext::system());
169 set_young_index_in_cset(-1);
170 uninstall_surv_rate_group();
171 set_free();
172 reset_pre_dummy_top();
173
174 if (!par) {
175 // If this is parallel, this will be done later.
176 HeapRegionRemSet* hrrs = rem_set();
177 if (locked) {
178 hrrs->clear_locked();
179 } else {
180 hrrs->clear();
181 }
182 }
183 zero_marked_bytes();
184
185 _offsets.resize(HeapRegion::GrainWords);
186 init_top_at_mark_start();
|
145 GrainWords = GrainBytes >> LogHeapWordSize;
146 guarantee((size_t) 1 << LogOfHRGrainWords == GrainWords, "sanity");
147
148 guarantee(CardsPerRegion == 0, "we should only set it once");
149 CardsPerRegion = GrainBytes >> CardTableModRefBS::card_shift;
150 }
151
152 void HeapRegion::reset_after_compaction() {
153 G1OffsetTableContigSpace::reset_after_compaction();
154 // After a compaction the mark bitmap is invalid, so we must
155 // treat all objects as being inside the unmarked area.
156 zero_marked_bytes();
157 init_top_at_mark_start();
158 }
159
160 void HeapRegion::hr_clear(bool par, bool clear_space, bool locked) {
161 assert(_humongous_start_region == NULL,
162 "we should have already filtered out humongous regions");
163 assert(_end == orig_end(),
164 "we should have already filtered out humongous regions");
165 assert(_in_collection_set == false,
166 "can't clear a heap region in the collection set");
167
168 set_allocation_context(AllocationContext::system());
169 set_young_index_in_cset(-1);
170 uninstall_surv_rate_group();
171 set_free();
172 reset_pre_dummy_top();
173
174 if (!par) {
175 // If this is parallel, this will be done later.
176 HeapRegionRemSet* hrrs = rem_set();
177 if (locked) {
178 hrrs->clear_locked();
179 } else {
180 hrrs->clear();
181 }
182 }
183 zero_marked_bytes();
184
185 _offsets.resize(HeapRegion::GrainWords);
186 init_top_at_mark_start();
|