Mercurial > hg > graal-jvmci-8
comparison src/share/vm/gc_interface/collectedHeap.cpp @ 14310:1e1c8d358b52
8030177: G1: Enable TLAB resizing
Reviewed-by: tschatzl, stefank, jmasa
author | brutisso |
---|---|
date | Mon, 27 Jan 2014 13:14:53 +0100 |
parents | 8f07aa079343 |
children | d8041d695d19 537c8e21b118 |
comparison
equal
deleted
inserted
replaced
14309:63a4eb8bcd23 | 14310:1e1c8d358b52 |
---|---|
316 bs->write_region(deferred); | 316 bs->write_region(deferred); |
317 // "Clear" the deferred_card_mark field | 317 // "Clear" the deferred_card_mark field |
318 thread->set_deferred_card_mark(MemRegion()); | 318 thread->set_deferred_card_mark(MemRegion()); |
319 } | 319 } |
320 assert(thread->deferred_card_mark().is_empty(), "invariant"); | 320 assert(thread->deferred_card_mark().is_empty(), "invariant"); |
321 } | |
322 | |
323 size_t CollectedHeap::max_tlab_size() const { | |
324 // TLABs can't be bigger than we can fill with a int[Integer.MAX_VALUE]. | |
325 // This restriction could be removed by enabling filling with multiple arrays. | |
326 // If we compute that the reasonable way as | |
327 // header_size + ((sizeof(jint) * max_jint) / HeapWordSize) | |
328 // we'll overflow on the multiply, so we do the divide first. | |
329 // We actually lose a little by dividing first, | |
330 // but that just makes the TLAB somewhat smaller than the biggest array, | |
331 // which is fine, since we'll be able to fill that. | |
332 size_t max_int_size = typeArrayOopDesc::header_size(T_INT) + | |
333 sizeof(jint) * | |
334 ((juint) max_jint / (size_t) HeapWordSize); | |
335 return align_size_down(max_int_size, MinObjAlignment); | |
321 } | 336 } |
322 | 337 |
323 // Helper for ReduceInitialCardMarks. For performance, | 338 // Helper for ReduceInitialCardMarks. For performance, |
324 // compiled code may elide card-marks for initializing stores | 339 // compiled code may elide card-marks for initializing stores |
325 // to a newly allocated object along the fast-path. We | 340 // to a newly allocated object along the fast-path. We |