comparison src/share/vm/memory/defNewGeneration.cpp @ 342:37f87013dfd8

6711316: Open source the Garbage-First garbage collector Summary: First mercurial integration of the code for the Garbage-First garbage collector. Reviewed-by: apetrusenko, iveresov, jmasa, sgoldman, tonyp, ysr
author ysr
date Thu, 05 Jun 2008 15:57:56 -0700
parents ba764ed4b6f2
children 60fb9c4db4e6
comparison
equal deleted inserted replaced
189:0b27f3512f9e 342:37f87013dfd8
212 212
213 MemRegion edenMR((HeapWord*)eden_start, (HeapWord*)from_start); 213 MemRegion edenMR((HeapWord*)eden_start, (HeapWord*)from_start);
214 MemRegion fromMR((HeapWord*)from_start, (HeapWord*)to_start); 214 MemRegion fromMR((HeapWord*)from_start, (HeapWord*)to_start);
215 MemRegion toMR ((HeapWord*)to_start, (HeapWord*)to_end); 215 MemRegion toMR ((HeapWord*)to_start, (HeapWord*)to_end);
216 216
217 eden()->initialize(edenMR, (minimum_eden_size == 0)); 217 eden()->set_bounds(edenMR);
218 // If minumum_eden_size != 0, we will not have cleared any 218 if (minimum_eden_size == 0) {
219 // portion of eden above its top. This can cause newly 219 // The "minimum_eden_size" is really the amount of eden occupied by
220 // expanded space not to be mangled if using ZapUnusedHeapArea. 220 // allocated objects -- if this is zero, then we can clear the space.
221 // We explicitly do such mangling here. 221 eden()->clear();
222 if (ZapUnusedHeapArea && (minimum_eden_size != 0)) { 222 } else {
223 eden()->mangle_unused_area(); 223 // Otherwise, we will not have cleared eden. This can cause newly
224 } 224 // expanded space not to be mangled if using ZapUnusedHeapArea.
225 from()->initialize(fromMR, true); 225 // We explicitly do such mangling here.
226 to()->initialize(toMR , true); 226 if (ZapUnusedHeapArea) {
227 eden()->set_next_compaction_space(from()); 227 eden()->mangle_unused_area();
228 }
229 }
230 from()->set_bounds(fromMR); from()->clear();
231 to()->set_bounds(toMR); to()->clear();
232 // Make sure we compact eden, then from.
228 // The to-space is normally empty before a compaction so need 233 // The to-space is normally empty before a compaction so need
229 // not be considered. The exception is during promotion 234 // not be considered. The exception is during promotion
230 // failure handling when to-space can contain live objects. 235 // failure handling when to-space can contain live objects.
236 eden()->set_next_compaction_space(from());
231 from()->set_next_compaction_space(NULL); 237 from()->set_next_compaction_space(NULL);
232 } 238 }
233 239
234 void DefNewGeneration::swap_spaces() { 240 void DefNewGeneration::swap_spaces() {
235 ContiguousSpace* s = from(); 241 ContiguousSpace* s = from();