comparison src/share/vm/gc_implementation/g1/g1RemSet.inline.hpp @ 1861:c32059ef4dc0

6971296: G1: simplify G1RemSet class hierarchy Summary: Remove G1RemSet base class and StupidG1RemSet class; rename HRInto_G1RemSet to just G1RemSet. Reviewed-by: ysr, tonyp
author johnc
date Tue, 12 Oct 2010 09:36:48 -0700
parents a03ae377b2e8
children 878b57474103
comparison
equal deleted inserted replaced
1843:0715f0cf171d 1861:c32059ef4dc0
28 } else { 28 } else {
29 return 1; 29 return 1;
30 } 30 }
31 } 31 }
32 32
33 template <class T> inline void HRInto_G1RemSet::write_ref_nv(HeapRegion* from, T* p) { 33 template <class T>
34 inline void G1RemSet::write_ref_nv(HeapRegion* from, T* p) {
34 par_write_ref_nv(from, p, 0); 35 par_write_ref_nv(from, p, 0);
35 } 36 }
36 37
37 inline bool HRInto_G1RemSet::self_forwarded(oop obj) { 38 inline bool G1RemSet::self_forwarded(oop obj) {
38 bool result = (obj->is_forwarded() && (obj->forwardee()== obj)); 39 bool result = (obj->is_forwarded() && (obj->forwardee()== obj));
39 return result; 40 return result;
40 } 41 }
41 42
42 template <class T> inline void HRInto_G1RemSet::par_write_ref_nv(HeapRegion* from, T* p, int tid) { 43 template <class T>
44 inline void G1RemSet::par_write_ref_nv(HeapRegion* from, T* p, int tid) {
43 oop obj = oopDesc::load_decode_heap_oop(p); 45 oop obj = oopDesc::load_decode_heap_oop(p);
44 #ifdef ASSERT 46 #ifdef ASSERT
45 // can't do because of races 47 // can't do because of races
46 // assert(obj == NULL || obj->is_oop(), "expected an oop"); 48 // assert(obj == NULL || obj->is_oop(), "expected an oop");
47 49
75 _cset_rs_update_cl[tid]->do_oop(p); 77 _cset_rs_update_cl[tid]->do_oop(p);
76 78
77 // Deferred updates to the CSet are either discarded (in the normal case), 79 // Deferred updates to the CSet are either discarded (in the normal case),
78 // or processed (if an evacuation failure occurs) at the end 80 // or processed (if an evacuation failure occurs) at the end
79 // of the collection. 81 // of the collection.
80 // See HRInto_G1RemSet::cleanup_after_oops_into_collection_set_do(). 82 // See G1RemSet::cleanup_after_oops_into_collection_set_do().
81 } else { 83 } else {
82 #if G1_REM_SET_LOGGING 84 #if G1_REM_SET_LOGGING
83 gclog_or_tty->print_cr("Adding " PTR_FORMAT " (" PTR_FORMAT ") to RS" 85 gclog_or_tty->print_cr("Adding " PTR_FORMAT " (" PTR_FORMAT ") to RS"
84 " for region [" PTR_FORMAT ", " PTR_FORMAT ")", 86 " for region [" PTR_FORMAT ", " PTR_FORMAT ")",
85 p, obj, 87 p, obj,
89 to->rem_set()->add_reference(p, tid); 91 to->rem_set()->add_reference(p, tid);
90 } 92 }
91 } 93 }
92 } 94 }
93 95
94 template <class T> inline void UpdateRSOopClosure::do_oop_work(T* p) { 96 template <class T>
97 inline void UpdateRSOopClosure::do_oop_work(T* p) {
95 assert(_from != NULL, "from region must be non-NULL"); 98 assert(_from != NULL, "from region must be non-NULL");
96 _rs->par_write_ref(_from, p, _worker_i); 99 _rs->par_write_ref(_from, p, _worker_i);
97 } 100 }
98 101
99 template <class T> inline void UpdateRSetImmediate::do_oop_work(T* p) { 102 template <class T>
103 inline void UpdateRSetImmediate::do_oop_work(T* p) {
100 assert(_from->is_in_reserved(p), "paranoia"); 104 assert(_from->is_in_reserved(p), "paranoia");
101 T heap_oop = oopDesc::load_heap_oop(p); 105 T heap_oop = oopDesc::load_heap_oop(p);
102 if (!oopDesc::is_null(heap_oop) && !_from->is_survivor()) { 106 if (!oopDesc::is_null(heap_oop) && !_from->is_survivor()) {
103 _g1_rem_set->par_write_ref(_from, p, 0); 107 _g1_rem_set->par_write_ref(_from, p, 0);
104 } 108 }