# HG changeset patch # User brutisso # Date 1429168579 -7200 # Node ID f911ce9bb9bacb54fbb7eb42b31cfe00fcdc815f # Parent 0538cccd8921eb42735f6aeefc756feb32fa7d04 8077841: G1: Remove PrintReachable support Reviewed-by: stefank, tschatzl diff -r 0538cccd8921 -r f911ce9bb9ba hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp Thu Apr 16 09:13:14 2015 +0200 +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp Thu Apr 16 09:16:19 2015 +0200 @@ -943,13 +943,6 @@ _has_aborted = false; -#ifndef PRODUCT - if (G1PrintReachableAtInitialMark) { - print_reachable("at-cycle-start", - VerifyOption_G1UsePrevMarking, true /* all */); - } -#endif - // Initialize marking structures. This has to be done in a STW phase. reset(); @@ -2684,166 +2677,6 @@ print_stats(); } -#ifndef PRODUCT - -class PrintReachableOopClosure: public OopClosure { -private: - G1CollectedHeap* _g1h; - outputStream* _out; - VerifyOption _vo; - bool _all; - -public: - PrintReachableOopClosure(outputStream* out, - VerifyOption vo, - bool all) : - _g1h(G1CollectedHeap::heap()), - _out(out), _vo(vo), _all(all) { } - - void do_oop(narrowOop* p) { do_oop_work(p); } - void do_oop( oop* p) { do_oop_work(p); } - - template void do_oop_work(T* p) { - oop obj = oopDesc::load_decode_heap_oop(p); - const char* str = NULL; - const char* str2 = ""; - - if (obj == NULL) { - str = ""; - } else if (!_g1h->is_in_g1_reserved(obj)) { - str = " O"; - } else { - HeapRegion* hr = _g1h->heap_region_containing(obj); - bool over_tams = _g1h->allocated_since_marking(obj, hr, _vo); - bool marked = _g1h->is_marked(obj, _vo); - - if (over_tams) { - str = " >"; - if (marked) { - str2 = " AND MARKED"; - } - } else if (marked) { - str = " M"; - } else { - str = " NOT"; - } - } - - _out->print_cr(" "PTR_FORMAT": "PTR_FORMAT"%s%s", - p2i(p), p2i((void*) obj), str, str2); - } -}; - -class PrintReachableObjectClosure : public ObjectClosure { -private: - G1CollectedHeap* _g1h; - outputStream* _out; - VerifyOption _vo; - bool _all; - HeapRegion* _hr; - -public: - PrintReachableObjectClosure(outputStream* out, - VerifyOption vo, - bool all, - HeapRegion* hr) : - _g1h(G1CollectedHeap::heap()), - _out(out), _vo(vo), _all(all), _hr(hr) { } - - void do_object(oop o) { - bool over_tams = _g1h->allocated_since_marking(o, _hr, _vo); - bool marked = _g1h->is_marked(o, _vo); - bool print_it = _all || over_tams || marked; - - if (print_it) { - _out->print_cr(" "PTR_FORMAT"%s", - p2i((void *)o), (over_tams) ? " >" : (marked) ? " M" : ""); - PrintReachableOopClosure oopCl(_out, _vo, _all); - o->oop_iterate_no_header(&oopCl); - } - } -}; - -class PrintReachableRegionClosure : public HeapRegionClosure { -private: - G1CollectedHeap* _g1h; - outputStream* _out; - VerifyOption _vo; - bool _all; - -public: - bool doHeapRegion(HeapRegion* hr) { - HeapWord* b = hr->bottom(); - HeapWord* e = hr->end(); - HeapWord* t = hr->top(); - HeapWord* p = _g1h->top_at_mark_start(hr, _vo); - _out->print_cr("** ["PTR_FORMAT", "PTR_FORMAT"] top: "PTR_FORMAT" " - "TAMS: " PTR_FORMAT, p2i(b), p2i(e), p2i(t), p2i(p)); - _out->cr(); - - HeapWord* from = b; - HeapWord* to = t; - - if (to > from) { - _out->print_cr("Objects in [" PTR_FORMAT ", " PTR_FORMAT "]", p2i(from), p2i(to)); - _out->cr(); - PrintReachableObjectClosure ocl(_out, _vo, _all, hr); - hr->object_iterate_mem_careful(MemRegion(from, to), &ocl); - _out->cr(); - } - - return false; - } - - PrintReachableRegionClosure(outputStream* out, - VerifyOption vo, - bool all) : - _g1h(G1CollectedHeap::heap()), _out(out), _vo(vo), _all(all) { } -}; - -void ConcurrentMark::print_reachable(const char* str, - VerifyOption vo, - bool all) { - gclog_or_tty->cr(); - gclog_or_tty->print_cr("== Doing heap dump... "); - - if (G1PrintReachableBaseFile == NULL) { - gclog_or_tty->print_cr(" #### error: no base file defined"); - return; - } - - if (strlen(G1PrintReachableBaseFile) + 1 + strlen(str) > - (JVM_MAXPATHLEN - 1)) { - gclog_or_tty->print_cr(" #### error: file name too long"); - return; - } - - char file_name[JVM_MAXPATHLEN]; - sprintf(file_name, "%s.%s", G1PrintReachableBaseFile, str); - gclog_or_tty->print_cr(" dumping to file %s", file_name); - - fileStream fout(file_name); - if (!fout.is_open()) { - gclog_or_tty->print_cr(" #### error: could not open file"); - return; - } - - outputStream* out = &fout; - out->print_cr("-- USING %s", _g1h->top_at_mark_start_str(vo)); - out->cr(); - - out->print_cr("--- ITERATING OVER REGIONS"); - out->cr(); - PrintReachableRegionClosure rcl(out, vo, all); - _g1h->heap_region_iterate(&rcl); - out->cr(); - - gclog_or_tty->print_cr(" done"); - gclog_or_tty->flush(); -} - -#endif // PRODUCT - void ConcurrentMark::clearRangePrevBitmap(MemRegion mr) { // Note we are overriding the read-only view of the prev map here, via // the cast. diff -r 0538cccd8921 -r f911ce9bb9ba hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Thu Apr 16 09:13:14 2015 +0200 +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Thu Apr 16 09:16:19 2015 +0200 @@ -3109,12 +3109,6 @@ // print_extended_on() instead of print_on(). print_extended_on(gclog_or_tty); gclog_or_tty->cr(); -#ifndef PRODUCT - if (VerifyDuringGC && G1VerifyDuringGCPrintReachable) { - concurrent_mark()->print_reachable("at-verification-failure", - vo, false /* all */); - } -#endif gclog_or_tty->flush(); } guarantee(!failures, "there should not have been any failures"); diff -r 0538cccd8921 -r f911ce9bb9ba hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp --- a/hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp Thu Apr 16 09:13:14 2015 +0200 +++ b/hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp Thu Apr 16 09:16:19 2015 +0200 @@ -41,15 +41,6 @@ develop(intx, G1MarkingVerboseLevel, 0, \ "Level (0-4) of verboseness of the marking code") \ \ - develop(bool, G1PrintReachableAtInitialMark, false, \ - "Reachable object dump at the initial mark pause") \ - \ - develop(bool, G1VerifyDuringGCPrintReachable, false, \ - "If conc mark verification fails, dump reachable objects") \ - \ - develop(ccstr, G1PrintReachableBaseFile, NULL, \ - "The base file name for the reachable object dumps") \ - \ develop(bool, G1TraceMarkStackOverflow, false, \ "If true, extra debugging code for CM restart for ovflw.") \ \