< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp

Print this page

162   if (thread->is_Java_thread()) {
163     PLAB* gclab = ShenandoahThreadLocalData::gclab(thread);
164     if (gclab != nullptr) {
165       gclab->retire();
166     }
167 
168     PLAB* plab = ShenandoahThreadLocalData::plab(thread);
169     if (plab != nullptr) {
170       // This will assert if plab is not null in non-generational mode
171       ShenandoahGenerationalHeap::heap()->retire_plab(plab);
172     }
173 
174     // SATB protocol requires to keep alive reachable oops from roots at the beginning of GC
175     if (ShenandoahStackWatermarkBarrier) {
176       if (_heap->is_concurrent_mark_in_progress()) {
177         ShenandoahKeepAliveClosure oops;
178         StackWatermarkSet::finish_processing(JavaThread::cast(thread), &oops, StackWatermarkKind::gc);
179       } else if (_heap->is_concurrent_weak_root_in_progress() && _heap->is_evacuation_in_progress()) {
180         ShenandoahContextEvacuateUpdateRootsClosure oops;
181         StackWatermarkSet::finish_processing(JavaThread::cast(thread), &oops, StackWatermarkKind::gc);



182       }
183     }
184   }
185 }
186 
187 void ShenandoahBarrierSet::write_ref_array(HeapWord* start, size_t count) {
188   assert(ShenandoahCardBarrier, "Should have been checked by caller");
189 
190   HeapWord* end = (HeapWord*)((char*) start + (count * heapOopSize));
191   // In the case of compressed oops, start and end may potentially be misaligned;
192   // so we need to conservatively align the first downward (this is not
193   // strictly necessary for current uses, but a case of good hygiene and,
194   // if you will, aesthetics) and the second upward (this is essential for
195   // current uses) to a HeapWord boundary, so we mark all cards overlapping
196   // this write.
197   HeapWord* aligned_start = align_down(start, HeapWordSize);
198   HeapWord* aligned_end   = align_up  (end,   HeapWordSize);
199   // If compressed oops were not being used, these should already be aligned
200   assert(UseCompressedOops || (aligned_start == start && aligned_end == end),
201          "Expected heap word alignment of start and end");

162   if (thread->is_Java_thread()) {
163     PLAB* gclab = ShenandoahThreadLocalData::gclab(thread);
164     if (gclab != nullptr) {
165       gclab->retire();
166     }
167 
168     PLAB* plab = ShenandoahThreadLocalData::plab(thread);
169     if (plab != nullptr) {
170       // This will assert if plab is not null in non-generational mode
171       ShenandoahGenerationalHeap::heap()->retire_plab(plab);
172     }
173 
174     // SATB protocol requires to keep alive reachable oops from roots at the beginning of GC
175     if (ShenandoahStackWatermarkBarrier) {
176       if (_heap->is_concurrent_mark_in_progress()) {
177         ShenandoahKeepAliveClosure oops;
178         StackWatermarkSet::finish_processing(JavaThread::cast(thread), &oops, StackWatermarkKind::gc);
179       } else if (_heap->is_concurrent_weak_root_in_progress() && _heap->is_evacuation_in_progress()) {
180         ShenandoahContextEvacuateUpdateRootsClosure oops;
181         StackWatermarkSet::finish_processing(JavaThread::cast(thread), &oops, StackWatermarkKind::gc);
182       } else if (ShenandoahGCStateCheckHotpatch) {
183         ShenandoahNoOpClosure oops;
184         StackWatermarkSet::finish_processing(JavaThread::cast(thread), &oops, StackWatermarkKind::gc);
185       }
186     }
187   }
188 }
189 
190 void ShenandoahBarrierSet::write_ref_array(HeapWord* start, size_t count) {
191   assert(ShenandoahCardBarrier, "Should have been checked by caller");
192 
193   HeapWord* end = (HeapWord*)((char*) start + (count * heapOopSize));
194   // In the case of compressed oops, start and end may potentially be misaligned;
195   // so we need to conservatively align the first downward (this is not
196   // strictly necessary for current uses, but a case of good hygiene and,
197   // if you will, aesthetics) and the second upward (this is essential for
198   // current uses) to a HeapWord boundary, so we mark all cards overlapping
199   // this write.
200   HeapWord* aligned_start = align_down(start, HeapWordSize);
201   HeapWord* aligned_end   = align_up  (end,   HeapWordSize);
202   // If compressed oops were not being used, these should already be aligned
203   assert(UseCompressedOops || (aligned_start == start && aligned_end == end),
204          "Expected heap word alignment of start and end");
< prev index next >