< prev index next >
src/hotspot/share/gc/g1/g1HeapVerifier.cpp
Print this page
*** 159,180 ****
int count() { return _count; }
void reset_count() { _count = 0; };
};
! class VerifyKlassClosure: public KlassClosure {
YoungRefCounterClosure _young_ref_counter_closure;
OopClosure *_oop_closure;
public:
! VerifyKlassClosure(G1CollectedHeap* g1h, OopClosure* cl) : _young_ref_counter_closure(g1h), _oop_closure(cl) {}
! void do_klass(Klass* k) {
! k->oops_do(_oop_closure);
_young_ref_counter_closure.reset_count();
! k->oops_do(&_young_ref_counter_closure);
if (_young_ref_counter_closure.count() > 0) {
! guarantee(k->has_modified_oops(), "Klass " PTR_FORMAT ", has young refs but is not dirty.", p2i(k));
}
}
};
class VerifyLivenessOopClosure: public OopClosure {
--- 159,181 ----
int count() { return _count; }
void reset_count() { _count = 0; };
};
! class VerifyCLDClosure: public CLDClosure {
YoungRefCounterClosure _young_ref_counter_closure;
OopClosure *_oop_closure;
+ G1CollectedHeap* _g1h;
public:
! VerifyCLDClosure(G1CollectedHeap* g1h, OopClosure* cl) : _g1h(g1h), _young_ref_counter_closure(g1h), _oop_closure(cl) {}
! void do_cld(ClassLoaderData* cld) {
! cld->oops_do(_oop_closure, false);
_young_ref_counter_closure.reset_count();
! cld->oops_do(&_young_ref_counter_closure, false);
if (_young_ref_counter_closure.count() > 0) {
! guarantee(cld->has_modified_oops(), "CLD " PTR_FORMAT ", has young %d refs but is not dirty.", p2i(cld), _young_ref_counter_closure.count());
}
}
};
class VerifyLivenessOopClosure: public OopClosure {
*** 388,399 ****
assert(Thread::current()->is_VM_thread(),
"Expected to be executed serially by the VM thread at this point");
log_debug(gc, verify)("Roots");
VerifyRootsClosure rootsCl(vo);
! VerifyKlassClosure klassCl(_g1h, &rootsCl);
! CLDToKlassAndOopClosure cldCl(&klassCl, &rootsCl, false);
// We apply the relevant closures to all the oops in the
// system dictionary, class loader data graph, the string table
// and the nmethods in the code cache.
G1VerifyCodeRootOopClosure codeRootsCl(_g1h, &rootsCl, vo);
--- 389,399 ----
assert(Thread::current()->is_VM_thread(),
"Expected to be executed serially by the VM thread at this point");
log_debug(gc, verify)("Roots");
VerifyRootsClosure rootsCl(vo);
! VerifyCLDClosure cldCl(_g1h, &rootsCl);
// We apply the relevant closures to all the oops in the
// system dictionary, class loader data graph, the string table
// and the nmethods in the code cache.
G1VerifyCodeRootOopClosure codeRootsCl(_g1h, &rootsCl, vo);
< prev index next >