equal
deleted
inserted
replaced
48 } |
48 } |
49 |
49 |
50 template <class T> |
50 template <class T> |
51 inline void PSPromotionManager::claim_or_forward_internal_depth(T* p) { |
51 inline void PSPromotionManager::claim_or_forward_internal_depth(T* p) { |
52 if (p != NULL) { // XXX: error if p != NULL here |
52 if (p != NULL) { // XXX: error if p != NULL here |
53 oop o = RawAccess<OOP_NOT_NULL>::oop_load(p); |
53 oop o = RawAccess<IS_NOT_NULL>::oop_load(p); |
54 if (o->is_forwarded()) { |
54 if (o->is_forwarded()) { |
55 o = o->forwardee(); |
55 o = o->forwardee(); |
56 // Card mark |
56 // Card mark |
57 if (PSScavenge::is_obj_in_young(o)) { |
57 if (PSScavenge::is_obj_in_young(o)) { |
58 PSScavenge::card_table()->inline_write_ref_field_gc(p, o); |
58 PSScavenge::card_table()->inline_write_ref_field_gc(p, o); |
59 } |
59 } |
60 RawAccess<OOP_NOT_NULL>::oop_store(p, o); |
60 RawAccess<IS_NOT_NULL>::oop_store(p, o); |
61 } else { |
61 } else { |
62 push_depth(p); |
62 push_depth(p); |
63 } |
63 } |
64 } |
64 } |
65 } |
65 } |
279 // attempting marking. |
279 // attempting marking. |
280 template <class T, bool promote_immediately> |
280 template <class T, bool promote_immediately> |
281 inline void PSPromotionManager::copy_and_push_safe_barrier(T* p) { |
281 inline void PSPromotionManager::copy_and_push_safe_barrier(T* p) { |
282 assert(should_scavenge(p, true), "revisiting object?"); |
282 assert(should_scavenge(p, true), "revisiting object?"); |
283 |
283 |
284 oop o = RawAccess<OOP_NOT_NULL>::oop_load(p); |
284 oop o = RawAccess<IS_NOT_NULL>::oop_load(p); |
285 oop new_obj = o->is_forwarded() |
285 oop new_obj = o->is_forwarded() |
286 ? o->forwardee() |
286 ? o->forwardee() |
287 : copy_to_survivor_space<promote_immediately>(o); |
287 : copy_to_survivor_space<promote_immediately>(o); |
288 |
288 |
289 // This code must come after the CAS test, or it will print incorrect |
289 // This code must come after the CAS test, or it will print incorrect |
292 log_develop_trace(gc, scavenge)("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}", |
292 log_develop_trace(gc, scavenge)("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}", |
293 "forwarding", |
293 "forwarding", |
294 new_obj->klass()->internal_name(), p2i((void *)o), p2i((void *)new_obj), new_obj->size()); |
294 new_obj->klass()->internal_name(), p2i((void *)o), p2i((void *)new_obj), new_obj->size()); |
295 } |
295 } |
296 |
296 |
297 RawAccess<OOP_NOT_NULL>::oop_store(p, new_obj); |
297 RawAccess<IS_NOT_NULL>::oop_store(p, new_obj); |
298 |
298 |
299 // We cannot mark without test, as some code passes us pointers |
299 // We cannot mark without test, as some code passes us pointers |
300 // that are outside the heap. These pointers are either from roots |
300 // that are outside the heap. These pointers are either from roots |
301 // or from metadata. |
301 // or from metadata. |
302 if ((!PSScavenge::is_obj_in_young((HeapWord*)p)) && |
302 if ((!PSScavenge::is_obj_in_young((HeapWord*)p)) && |