137 }
138 oop obj = CompressedOops::decode_not_null(o);
139
140 check_obj_during_refinement(p, obj);
141
142 if (HeapRegion::is_in_same_region(p, obj)) {
143 // Normally this closure should only be called with cross-region references.
144 // But since Java threads are manipulating the references concurrently and we
145 // reload the values things may have changed.
146 // Also this check lets slip through references from a humongous continues region
147 // to its humongous start region, as they are in different regions, and adds a
148 // remembered set entry. This is benign (apart from memory usage), as we never
149 // try to either evacuate or eager reclaim humonguous arrays of j.l.O.
150 return;
151 }
152
153 HeapRegionRemSet* to_rem_set = _g1h->heap_region_containing(obj)->rem_set();
154
155 assert(to_rem_set != NULL, "Need per-region 'into' remsets.");
156 if (to_rem_set->is_tracked()) {
157 to_rem_set->add_reference(p, _worker_i);
158 }
159 }
160
161 template <class T>
162 inline void G1ScanCardClosure::do_oop_work(T* p) {
163 T o = RawAccess<>::oop_load(p);
164 if (CompressedOops::is_null(o)) {
165 return;
166 }
167 oop obj = CompressedOops::decode_not_null(o);
168
169 check_obj_during_refinement(p, obj);
170
171 assert(!_g1h->is_in_cset((HeapWord*)p),
172 "Oop originates from " PTR_FORMAT " (region: %u) which is in the collection set.",
173 p2i(p), _g1h->addr_to_region((HeapWord*)p));
174
175 const G1HeapRegionAttr region_attr = _g1h->region_attr(obj);
176 if (region_attr.is_in_cset()) {
177 // Since the source is always from outside the collection set, here we implicitly know
|
137 }
138 oop obj = CompressedOops::decode_not_null(o);
139
140 check_obj_during_refinement(p, obj);
141
142 if (HeapRegion::is_in_same_region(p, obj)) {
143 // Normally this closure should only be called with cross-region references.
144 // But since Java threads are manipulating the references concurrently and we
145 // reload the values things may have changed.
146 // Also this check lets slip through references from a humongous continues region
147 // to its humongous start region, as they are in different regions, and adds a
148 // remembered set entry. This is benign (apart from memory usage), as we never
149 // try to either evacuate or eager reclaim humonguous arrays of j.l.O.
150 return;
151 }
152
153 HeapRegionRemSet* to_rem_set = _g1h->heap_region_containing(obj)->rem_set();
154
155 assert(to_rem_set != NULL, "Need per-region 'into' remsets.");
156 if (to_rem_set->is_tracked()) {
157 to_rem_set->add_reference(p, _worker_id);
158 }
159 }
160
161 template <class T>
162 inline void G1ScanCardClosure::do_oop_work(T* p) {
163 T o = RawAccess<>::oop_load(p);
164 if (CompressedOops::is_null(o)) {
165 return;
166 }
167 oop obj = CompressedOops::decode_not_null(o);
168
169 check_obj_during_refinement(p, obj);
170
171 assert(!_g1h->is_in_cset((HeapWord*)p),
172 "Oop originates from " PTR_FORMAT " (region: %u) which is in the collection set.",
173 p2i(p), _g1h->addr_to_region((HeapWord*)p));
174
175 const G1HeapRegionAttr region_attr = _g1h->region_attr(obj);
176 if (region_attr.is_in_cset()) {
177 // Since the source is always from outside the collection set, here we implicitly know
|