27 |
27 |
28 #include "gc_implementation/g1/concurrentMark.inline.hpp" |
28 #include "gc_implementation/g1/concurrentMark.inline.hpp" |
29 #include "gc_implementation/g1/g1CollectedHeap.hpp" |
29 #include "gc_implementation/g1/g1CollectedHeap.hpp" |
30 #include "gc_implementation/g1/g1OopClosures.hpp" |
30 #include "gc_implementation/g1/g1OopClosures.hpp" |
31 #include "gc_implementation/g1/g1RemSet.hpp" |
31 #include "gc_implementation/g1/g1RemSet.hpp" |
|
32 #include "gc_implementation/g1/heapRegionRemSet.hpp" |
32 |
33 |
33 /* |
34 /* |
34 * This really ought to be an inline function, but apparently the C++ |
35 * This really ought to be an inline function, but apparently the C++ |
35 * compiler sometimes sees fit to ignore inline declarations. Sigh. |
36 * compiler sometimes sees fit to ignore inline declarations. Sigh. |
36 */ |
37 */ |
180 assert(Universe::heap()->is_in_reserved(obj), "must be in heap"); |
181 assert(Universe::heap()->is_in_reserved(obj), "must be in heap"); |
181 } |
182 } |
182 #endif // ASSERT |
183 #endif // ASSERT |
183 |
184 |
184 assert(_from != NULL, "from region must be non-NULL"); |
185 assert(_from != NULL, "from region must be non-NULL"); |
|
186 assert(_from->is_in_reserved(p), "p is not in from"); |
185 |
187 |
186 HeapRegion* to = _g1->heap_region_containing(obj); |
188 HeapRegion* to = _g1->heap_region_containing(obj); |
187 if (to != NULL && _from != to) { |
189 if (to != NULL && _from != to) { |
188 // The _record_refs_into_cset flag is true during the RSet |
190 // The _record_refs_into_cset flag is true during the RSet |
189 // updating part of an evacuation pause. It is false at all |
191 // updating part of an evacuation pause. It is false at all |
210 |
212 |
211 // Deferred updates to the CSet are either discarded (in the normal case), |
213 // Deferred updates to the CSet are either discarded (in the normal case), |
212 // or processed (if an evacuation failure occurs) at the end |
214 // or processed (if an evacuation failure occurs) at the end |
213 // of the collection. |
215 // of the collection. |
214 // See G1RemSet::cleanup_after_oops_into_collection_set_do(). |
216 // See G1RemSet::cleanup_after_oops_into_collection_set_do(). |
215 } else { |
217 return; |
216 // We either don't care about pushing references that point into the |
218 } |
217 // collection set (i.e. we're not during an evacuation pause) _or_ |
219 |
218 // the reference doesn't point into the collection set. Either way |
220 // We either don't care about pushing references that point into the |
219 // we add the reference directly to the RSet of the region containing |
221 // collection set (i.e. we're not during an evacuation pause) _or_ |
220 // the referenced object. |
222 // the reference doesn't point into the collection set. Either way |
221 _g1_rem_set->par_write_ref(_from, p, _worker_i); |
223 // we add the reference directly to the RSet of the region containing |
222 } |
224 // the referenced object. |
|
225 assert(to->rem_set() != NULL, "Need per-region 'into' remsets."); |
|
226 to->rem_set()->add_reference(p, _worker_i); |
223 } |
227 } |
224 } |
228 } |
225 |
229 |
226 #endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1OOPCLOSURES_INLINE_HPP |
230 #endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1OOPCLOSURES_INLINE_HPP |