< prev index next >
src/share/vm/gc_implementation/shenandoah/shenandoahPrinter.cpp
Print this page
rev 10528 : [backport] SH::make_(tlabs)_parsable() should work correctly with/without TLABs
rev 10538 : [backport] VSC++ requires space(s) in between two string literals
rev 10580 : [backport] Refactor to group marking bitmap and TAMS structure in one class ShenandoahMarkingContext
*** 26,35 ****
--- 26,36 ----
#ifdef ASSERT
#include "memory/allocation.hpp"
#include "gc_implementation/shenandoah/shenandoahHeap.hpp"
#include "gc_implementation/shenandoah/shenandoahHeap.inline.hpp"
+ #include "gc_implementation/shenandoah/shenandoahMarkingContext.inline.hpp"
#include "gc_implementation/shenandoah/shenandoahPrinter.hpp"
class ShenandoahPrintAllRefsOopClosure: public ExtendedOopClosure {
private:
int _index;
*** 42,63 ****
template <class T>
inline void do_oop_work(T* p) {
oop o = oopDesc::load_decode_heap_oop(p);
if (o != NULL) {
if (ShenandoahHeap::heap()->is_in(o) && o->is_oop()) {
! tty->print_cr("%s "INT32_FORMAT" ("PTR_FORMAT")-> "PTR_FORMAT" (marked: %s) (%s "PTR_FORMAT")",
_prefix, _index,
p2i(p), p2i(o),
! BOOL_TO_STR(ShenandoahHeap::heap()->is_marked_complete(o)),
o->klass()->internal_name(), p2i(o->klass()));
} else {
! tty->print_cr("%s "INT32_FORMAT" ("PTR_FORMAT" dirty -> "PTR_FORMAT" (not in heap, possibly corrupted or dirty)",
_prefix, _index,
p2i(p), p2i(o));
}
} else {
! tty->print_cr("%s "INT32_FORMAT" ("PTR_FORMAT") -> "PTR_FORMAT, _prefix, _index, p2i(p), p2i((HeapWord*) o));
}
_index++;
}
public:
--- 43,64 ----
template <class T>
inline void do_oop_work(T* p) {
oop o = oopDesc::load_decode_heap_oop(p);
if (o != NULL) {
if (ShenandoahHeap::heap()->is_in(o) && o->is_oop()) {
! tty->print_cr("%s " INT32_FORMAT " (" PTR_FORMAT ")-> " PTR_FORMAT " (marked: %s) (%s " PTR_FORMAT ")",
_prefix, _index,
p2i(p), p2i(o),
! BOOL_TO_STR(ShenandoahHeap::heap()->complete_marking_context()->is_marked(o)),
o->klass()->internal_name(), p2i(o->klass()));
} else {
! tty->print_cr("%s " INT32_FORMAT " (" PTR_FORMAT " dirty -> " PTR_FORMAT " (not in heap, possibly corrupted or dirty)",
_prefix, _index,
p2i(p), p2i(o));
}
} else {
! tty->print_cr("%s " INT32_FORMAT " (" PTR_FORMAT ") -> " PTR_FORMAT, _prefix, _index, p2i(p), p2i((HeapWord*) o));
}
_index++;
}
public:
*** 76,88 ****
public:
ShenandoahPrintAllRefsObjectClosure(const char* prefix) : _prefix(prefix) {}
void do_object(oop p) {
if (ShenandoahHeap::heap()->is_in(p)) {
! tty->print_cr("%s object "PTR_FORMAT" (marked: %s) (%s "PTR_FORMAT") refers to:",
_prefix, p2i(p),
! BOOL_TO_STR(ShenandoahHeap::heap()->is_marked_complete(p)),
p->klass()->internal_name(), p2i(p->klass()));
ShenandoahPrintAllRefsOopClosure cl(_prefix);
p->oop_iterate(&cl);
}
}
--- 77,89 ----
public:
ShenandoahPrintAllRefsObjectClosure(const char* prefix) : _prefix(prefix) {}
void do_object(oop p) {
if (ShenandoahHeap::heap()->is_in(p)) {
! tty->print_cr("%s object " PTR_FORMAT " (marked: %s) (%s " PTR_FORMAT ") refers to:",
_prefix, p2i(p),
! BOOL_TO_STR(ShenandoahHeap::heap()->complete_marking_context()->is_marked(p)),
p->klass()->internal_name(), p2i(p->klass()));
ShenandoahPrintAllRefsOopClosure cl(_prefix);
p->oop_iterate(&cl);
}
}
*** 90,100 ****
void ShenandoahPrinter::print_all_refs(const char* prefix) {
tty->print_cr("printing all references in the heap");
tty->print_cr("root references:");
! _heap->make_tlabs_parsable(false);
ShenandoahPrintAllRefsOopClosure cl(prefix);
_heap->roots_iterate(&cl);
tty->print_cr("heap references:");
--- 91,101 ----
void ShenandoahPrinter::print_all_refs(const char* prefix) {
tty->print_cr("printing all references in the heap");
tty->print_cr("root references:");
! _heap->make_parsable(false);
ShenandoahPrintAllRefsOopClosure cl(prefix);
_heap->roots_iterate(&cl);
tty->print_cr("heap references:");
< prev index next >