src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp

Print this page

        

*** 82,113 **** // The same test as "o->is_forwarded()" if (!test_mark->is_marked()) { bool new_obj_is_tenured = false; size_t new_obj_size = o->size(); - - if (!promote_immediately) { // Find the objects age, MT safe. uint age = (test_mark->has_displaced_mark_helper() /* o->has_displaced_mark() */) ? test_mark->displaced_mark_helper()->age() : test_mark->age(); // Try allocating obj in to-space (unless too old) if (age < PSScavenge::tenuring_threshold()) { new_obj = (oop) _young_lab.allocate(new_obj_size); if (new_obj == NULL && !_young_gen_is_full) { // Do we allocate directly, or flush and refill? if (new_obj_size > (YoungPLABSize / 2)) { // Allocate this object directly new_obj = (oop)young_space()->cas_allocate(new_obj_size); } else { // Flush and fill _young_lab.flush(); HeapWord* lab_base = young_space()->cas_allocate(YoungPLABSize); if (lab_base != NULL) { _young_lab.initialize(MemRegion(lab_base, YoungPLABSize)); // Try the young lab allocation again. new_obj = (oop) _young_lab.allocate(new_obj_size); } else { _young_gen_is_full = true; } } --- 82,114 ---- // The same test as "o->is_forwarded()" if (!test_mark->is_marked()) { bool new_obj_is_tenured = false; size_t new_obj_size = o->size(); // Find the objects age, MT safe. uint age = (test_mark->has_displaced_mark_helper() /* o->has_displaced_mark() */) ? test_mark->displaced_mark_helper()->age() : test_mark->age(); + if (!promote_immediately) { // Try allocating obj in to-space (unless too old) if (age < PSScavenge::tenuring_threshold()) { new_obj = (oop) _young_lab.allocate(new_obj_size); if (new_obj == NULL && !_young_gen_is_full) { // Do we allocate directly, or flush and refill? if (new_obj_size > (YoungPLABSize / 2)) { // Allocate this object directly + PSScavenge::_gc_tracer.report_promotion_to_new_plab(o, age, false, new_obj_size); new_obj = (oop)young_space()->cas_allocate(new_obj_size); } else { // Flush and fill _young_lab.flush(); HeapWord* lab_base = young_space()->cas_allocate(YoungPLABSize); if (lab_base != NULL) { _young_lab.initialize(MemRegion(lab_base, YoungPLABSize)); // Try the young lab allocation again. + PSScavenge::_gc_tracer.report_promotion_to_new_plab(o, age, false, _young_lab.capacity()); new_obj = (oop) _young_lab.allocate(new_obj_size); } else { _young_gen_is_full = true; } }
*** 129,138 **** --- 130,140 ---- if (new_obj == NULL) { if (!_old_gen_is_full) { // Do we allocate directly, or flush and refill? if (new_obj_size > (OldPLABSize / 2)) { // Allocate this object directly + PSScavenge::_gc_tracer.report_promotion_to_new_plab(o, age, true, new_obj_size); new_obj = (oop)old_gen()->cas_allocate(new_obj_size); } else { // Flush and fill _old_lab.flush();
*** 144,153 **** --- 146,156 ---- if (GCWorkerDelayMillis > 0) { os::sleep(Thread::current(), GCWorkerDelayMillis, false); } #endif _old_lab.initialize(MemRegion(lab_base, OldPLABSize)); + PSScavenge::_gc_tracer.report_promotion_to_new_plab(o, age, true, _old_lab.capacity()); // Try the old lab allocation again. new_obj = (oop) _old_lab.allocate(new_obj_size); } } }