comparison src/share/vm/memory/genOopClosures.inline.hpp @ 845:df6caf649ff7

6700789: G1: Enable use of compressed oops with G1 heaps Summary: Modifications to G1 so as to allow the use of compressed oops. Reviewed-by: apetrusenko, coleenp, jmasa, kvn, never, phh, tonyp
author ysr
date Tue, 14 Jul 2009 15:40:39 -0700
parents 1ee8caae33af
children c18cbe5936b8
comparison
equal deleted inserted replaced
839:bb18957ad21e 845:df6caf649ff7
38 } 38 }
39 } 39 }
40 40
41 template <class T> inline void OopsInGenClosure::do_barrier(T* p) { 41 template <class T> inline void OopsInGenClosure::do_barrier(T* p) {
42 assert(generation()->is_in_reserved(p), "expected ref in generation"); 42 assert(generation()->is_in_reserved(p), "expected ref in generation");
43 assert(!oopDesc::is_null(*p), "expected non-null object"); 43 T heap_oop = oopDesc::load_heap_oop(p);
44 oop obj = oopDesc::load_decode_heap_oop_not_null(p); 44 assert(!oopDesc::is_null(heap_oop), "expected non-null oop");
45 oop obj = oopDesc::decode_heap_oop_not_null(heap_oop);
45 // If p points to a younger generation, mark the card. 46 // If p points to a younger generation, mark the card.
46 if ((HeapWord*)obj < _gen_boundary) { 47 if ((HeapWord*)obj < _gen_boundary) {
47 _rs->inline_write_ref_field_gc(p, obj); 48 _rs->inline_write_ref_field_gc(p, obj);
48 } 49 }
49 } 50 }
50 51
51 inline void OopsInGenClosure::par_do_barrier(oop* p) { 52 template <class T> inline void OopsInGenClosure::par_do_barrier(T* p) {
52 assert(generation()->is_in_reserved(p), "expected ref in generation"); 53 assert(generation()->is_in_reserved(p), "expected ref in generation");
53 oop obj = *p; 54 T heap_oop = oopDesc::load_heap_oop(p);
54 assert(obj != NULL, "expected non-null object"); 55 assert(!oopDesc::is_null(heap_oop), "expected non-null oop");
56 oop obj = oopDesc::decode_heap_oop_not_null(heap_oop);
55 // If p points to a younger generation, mark the card. 57 // If p points to a younger generation, mark the card.
56 if ((HeapWord*)obj < gen_boundary()) { 58 if ((HeapWord*)obj < gen_boundary()) {
57 rs()->write_ref_field_gc_par(p, obj); 59 rs()->write_ref_field_gc_par(p, obj);
58 } 60 }
59 } 61 }