8031323: Optionally align objects copied to survivor spaces

Reviewed-by: brutisso, tschatzl
This commit is contained in:
Jon Masamitsu 2014-08-01 15:40:12 -07:00
parent a959c0971e
commit 5f2c33e42b
16 changed files with 201 additions and 25 deletions

View file

@ -288,7 +288,12 @@ void G1ParScanThreadState::undo_allocation(GCAllocPurpose purpose, HeapWord* obj
}
HeapWord* G1ParScanThreadState::allocate(GCAllocPurpose purpose, size_t word_sz) {
HeapWord* obj = alloc_buffer(purpose)->allocate(word_sz);
HeapWord* obj = NULL;
if (purpose == GCAllocForSurvived) {
obj = alloc_buffer(GCAllocForSurvived)->allocate_aligned(word_sz, SurvivorAlignmentInBytes);
} else {
obj = alloc_buffer(GCAllocForTenured)->allocate(word_sz);
}
if (obj != NULL) {
return obj;
}