--- old/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp 2014-11-06 01:36:44.973526377 -0800 +++ new/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp 2014-11-06 01:36:44.877526380 -0800 @@ -84,12 +84,11 @@ 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) { - // 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); @@ -98,6 +97,12 @@ if (new_obj_size > (YoungPLABSize / 2)) { // Allocate this object directly new_obj = (oop)young_space()->cas_allocate(new_obj_size); + if (new_obj != NULL) { + PSScavenge::gc_tracer()->report_promotion_outside_plab_event(o, + new_obj_size, + age, + false); + } } else { // Flush and fill _young_lab.flush(); @@ -107,6 +112,14 @@ _young_lab.initialize(MemRegion(lab_base, YoungPLABSize)); // Try the young lab allocation again. new_obj = (oop) _young_lab.allocate(new_obj_size); + if (new_obj != NULL) { + size_t lab_size = pointer_delta(_young_lab.end(), _young_lab.bottom()); + PSScavenge::gc_tracer()->report_promotion_in_new_plab_event(o, + new_obj_size, + age, + false, + lab_size); + } } else { _young_gen_is_full = true; } @@ -132,6 +145,12 @@ if (new_obj_size > (OldPLABSize / 2)) { // Allocate this object directly new_obj = (oop)old_gen()->cas_allocate(new_obj_size); + if (new_obj != NULL) { + PSScavenge::gc_tracer()->report_promotion_outside_plab_event(o, + new_obj_size, + age, + true); + } } else { // Flush and fill _old_lab.flush(); @@ -148,6 +167,14 @@ _old_lab.initialize(MemRegion(lab_base, OldPLABSize)); // Try the old lab allocation again. new_obj = (oop) _old_lab.allocate(new_obj_size); + if (new_obj != NULL) { + size_t lab_size = pointer_delta(_old_lab.end(), _old_lab.bottom()); + PSScavenge::gc_tracer()->report_promotion_in_new_plab_event(o, + new_obj_size, + age, + true, + lab_size); + } } } }