Mercurial > hg > graal-compiler
diff src/share/vm/gc_implementation/g1/g1ParScanThreadState.cpp @ 20317:ee019285a52c
8031323: Optionally align objects copied to survivor spaces
Reviewed-by: brutisso, tschatzl
author | jmasa |
---|---|
date | Mon, 04 Aug 2014 10:48:10 -0700 |
parents | cd43876f692e |
children | 227a9e5e4b4a |
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/g1/g1ParScanThreadState.cpp Thu Aug 07 18:09:12 2014 -0700 +++ b/src/share/vm/gc_implementation/g1/g1ParScanThreadState.cpp Mon Aug 04 10:48:10 2014 -0700 @@ -288,7 +288,12 @@ } 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; }