209 CollectedHeap::fill_with_object((HeapWord*) new_obj, new_obj_size);
210 }
211 } else if (!_young_lab.unallocate_object((HeapWord*) new_obj, new_obj_size)) {
212 CollectedHeap::fill_with_object((HeapWord*) new_obj, new_obj_size);
213 }
214
215 // don't update this before the unallocation!
216 new_obj = o->forwardee();
217 }
218 } else {
219 assert(o->is_forwarded(), "Sanity");
220 new_obj = o->forwardee();
221 }
222
223 #ifndef PRODUCT
224 // This code must come after the CAS test, or it will print incorrect
225 // information.
226 if (TraceScavenge) {
227 gclog_or_tty->print_cr("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}",
228 PSScavenge::should_scavenge(&new_obj) ? "copying" : "tenuring",
229 new_obj->klass()->internal_name(), (void *)o, (void *)new_obj, new_obj->size());
230 }
231 #endif
232
233 return new_obj;
234 }
235
236
237 inline void PSPromotionManager::process_popped_location_depth(StarTask p) {
238 if (is_oop_masked(p)) {
239 assert(PSChunkLargeArrays, "invariant");
240 oop const old = unmask_chunked_array_oop(p);
241 process_array_chunk(old);
242 } else {
243 if (p.is_narrow()) {
244 assert(UseCompressedOops, "Error");
245 PSScavenge::copy_and_push_safe_barrier<narrowOop, /*promote_immediately=*/false>(this, p);
246 } else {
247 PSScavenge::copy_and_push_safe_barrier<oop, /*promote_immediately=*/false>(this, p);
248 }
249 }
|
209 CollectedHeap::fill_with_object((HeapWord*) new_obj, new_obj_size);
210 }
211 } else if (!_young_lab.unallocate_object((HeapWord*) new_obj, new_obj_size)) {
212 CollectedHeap::fill_with_object((HeapWord*) new_obj, new_obj_size);
213 }
214
215 // don't update this before the unallocation!
216 new_obj = o->forwardee();
217 }
218 } else {
219 assert(o->is_forwarded(), "Sanity");
220 new_obj = o->forwardee();
221 }
222
223 #ifndef PRODUCT
224 // This code must come after the CAS test, or it will print incorrect
225 // information.
226 if (TraceScavenge) {
227 gclog_or_tty->print_cr("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}",
228 PSScavenge::should_scavenge(&new_obj) ? "copying" : "tenuring",
229 new_obj->klass()->internal_name(), p2i((void *)o), p2i((void *)new_obj), new_obj->size());
230 }
231 #endif
232
233 return new_obj;
234 }
235
236
237 inline void PSPromotionManager::process_popped_location_depth(StarTask p) {
238 if (is_oop_masked(p)) {
239 assert(PSChunkLargeArrays, "invariant");
240 oop const old = unmask_chunked_array_oop(p);
241 process_array_chunk(old);
242 } else {
243 if (p.is_narrow()) {
244 assert(UseCompressedOops, "Error");
245 PSScavenge::copy_and_push_safe_barrier<narrowOop, /*promote_immediately=*/false>(this, p);
246 } else {
247 PSScavenge::copy_and_push_safe_barrier<oop, /*promote_immediately=*/false>(this, p);
248 }
249 }
|