299
300 bool ShenandoahNMethod::has_cset_oops(ShenandoahHeap *heap) {
301 for (int c = 0; c < _oops_count; c++) {
302 oop o = RawAccess<>::oop_load(_oops[c]);
303 if (heap->in_collection_set(o)) {
304 return true;
305 }
306 }
307 return false;
308 }
309
310 #ifdef ASSERT
311 void ShenandoahNMethod::assert_alive_and_correct() {
312 assert(_nm->is_alive(), "only alive nmethods here");
313 assert(_oops_count > 0, "should have filtered nmethods without oops before");
314 ShenandoahHeap* heap = ShenandoahHeap::heap();
315 for (int c = 0; c < _oops_count; c++) {
316 oop *loc = _oops[c];
317 assert(_nm->code_contains((address) loc) || _nm->oops_contains(loc), "nmethod should contain the oop*");
318 oop o = RawAccess<>::oop_load(loc);
319 shenandoah_assert_correct_except(loc, o, o == NULL || heap->is_full_gc_move_in_progress());
320 }
321 }
322
323 void ShenandoahNMethod::assert_same_oops(GrowableArray<oop*>* oops) {
324 assert(_oops_count == oops->length(), "should have the same number of oop*");
325 for (int c = 0; c < _oops_count; c++) {
326 assert(_oops[c] == oops->at(c), "should be the same oop*");
327 }
328 }
329 #endif
|
299
300 bool ShenandoahNMethod::has_cset_oops(ShenandoahHeap *heap) {
301 for (int c = 0; c < _oops_count; c++) {
302 oop o = RawAccess<>::oop_load(_oops[c]);
303 if (heap->in_collection_set(o)) {
304 return true;
305 }
306 }
307 return false;
308 }
309
310 #ifdef ASSERT
311 void ShenandoahNMethod::assert_alive_and_correct() {
312 assert(_nm->is_alive(), "only alive nmethods here");
313 assert(_oops_count > 0, "should have filtered nmethods without oops before");
314 ShenandoahHeap* heap = ShenandoahHeap::heap();
315 for (int c = 0; c < _oops_count; c++) {
316 oop *loc = _oops[c];
317 assert(_nm->code_contains((address) loc) || _nm->oops_contains(loc), "nmethod should contain the oop*");
318 oop o = RawAccess<>::oop_load(loc);
319 shenandoah_assert_correct_except(loc, o,
320 o == NULL ||
321 heap->is_full_gc_move_in_progress() ||
322 (VMThread::vm_operation() != NULL) && (VMThread::vm_operation()->type() == VM_Operation::VMOp_HeapWalkOperation)
323 );
324 }
325 }
326
327 void ShenandoahNMethod::assert_same_oops(GrowableArray<oop*>* oops) {
328 assert(_oops_count == oops->length(), "should have the same number of oop*");
329 for (int c = 0; c < _oops_count; c++) {
330 assert(_oops[c] == oops->at(c), "should be the same oop*");
331 }
332 }
333 #endif
|