Mercurial > hg > graal-compiler
comparison src/share/vm/gc_implementation/g1/g1RemSet.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 | 96b229c54d1e |
children | 18f526145aea |
comparison
equal
deleted
inserted
replaced
839:bb18957ad21e | 845:df6caf649ff7 |
---|---|
28 } else { | 28 } else { |
29 return 1; | 29 return 1; |
30 } | 30 } |
31 } | 31 } |
32 | 32 |
33 inline void HRInto_G1RemSet::write_ref_nv(HeapRegion* from, oop* p) { | 33 template <class T> inline void HRInto_G1RemSet::write_ref_nv(HeapRegion* from, T* p) { |
34 par_write_ref(from, p, 0); | 34 par_write_ref_nv(from, p, 0); |
35 } | |
36 | |
37 inline void HRInto_G1RemSet::write_ref(HeapRegion* from, oop* p) { | |
38 write_ref_nv(from, p); | |
39 } | 35 } |
40 | 36 |
41 inline bool HRInto_G1RemSet::self_forwarded(oop obj) { | 37 inline bool HRInto_G1RemSet::self_forwarded(oop obj) { |
42 bool result = (obj->is_forwarded() && (obj->forwardee()== obj)); | 38 bool result = (obj->is_forwarded() && (obj->forwardee()== obj)); |
43 return result; | 39 return result; |
44 } | 40 } |
45 | 41 |
46 inline void HRInto_G1RemSet::par_write_ref(HeapRegion* from, oop* p, int tid) { | 42 template <class T> inline void HRInto_G1RemSet::par_write_ref_nv(HeapRegion* from, T* p, int tid) { |
47 oop obj = *p; | 43 oop obj = oopDesc::load_decode_heap_oop(p); |
48 #ifdef ASSERT | 44 #ifdef ASSERT |
49 // can't do because of races | 45 // can't do because of races |
50 // assert(obj == NULL || obj->is_oop(), "expected an oop"); | 46 // assert(obj == NULL || obj->is_oop(), "expected an oop"); |
51 | 47 |
52 // Do the safe subset of is_oop | 48 // Do the safe subset of is_oop |
69 // self forwarding pointers onto our _new_refs list. | 65 // self forwarding pointers onto our _new_refs list. |
70 // The _par_traversal_in_progress flag is true during the collection pause, | 66 // The _par_traversal_in_progress flag is true during the collection pause, |
71 // false during the evacuation failure handing. | 67 // false during the evacuation failure handing. |
72 if (_par_traversal_in_progress && | 68 if (_par_traversal_in_progress && |
73 to->in_collection_set() && !self_forwarded(obj)) { | 69 to->in_collection_set() && !self_forwarded(obj)) { |
74 _new_refs[tid]->push(p); | 70 _new_refs[tid]->push((void*)p); |
75 // Deferred updates to the Cset are either discarded (in the normal case), | 71 // Deferred updates to the Cset are either discarded (in the normal case), |
76 // or processed (if an evacuation failure occurs) at the end | 72 // or processed (if an evacuation failure occurs) at the end |
77 // of the collection. | 73 // of the collection. |
78 // See HRInto_G1RemSet::cleanup_after_oops_into_collection_set_do(). | 74 // See HRInto_G1RemSet::cleanup_after_oops_into_collection_set_do(). |
79 } else { | 75 } else { |
87 to->rem_set()->add_reference(p, tid); | 83 to->rem_set()->add_reference(p, tid); |
88 } | 84 } |
89 } | 85 } |
90 } | 86 } |
91 | 87 |
92 inline void UpdateRSOopClosure::do_oop(narrowOop* p) { | 88 template <class T> inline void UpdateRSOopClosure::do_oop_work(T* p) { |
93 guarantee(false, "NYI"); | |
94 } | |
95 | |
96 inline void UpdateRSOopClosure::do_oop(oop* p) { | |
97 assert(_from != NULL, "from region must be non-NULL"); | 89 assert(_from != NULL, "from region must be non-NULL"); |
98 _rs->par_write_ref(_from, p, _worker_i); | 90 _rs->par_write_ref(_from, p, _worker_i); |
99 } | 91 } |