hotspot/src/share/vm/gc/g1/heapRegion.cpp
changeset 46701 f559541c0daa
parent 46630 75aa3e39d02c
child 46810 7dad333205cd
equal deleted inserted replaced
46700:e097aad8f3f8 46701:f559541c0daa
    34 #include "gc/g1/heapRegionRemSet.hpp"
    34 #include "gc/g1/heapRegionRemSet.hpp"
    35 #include "gc/g1/heapRegionTracer.hpp"
    35 #include "gc/g1/heapRegionTracer.hpp"
    36 #include "gc/shared/genOopClosures.inline.hpp"
    36 #include "gc/shared/genOopClosures.inline.hpp"
    37 #include "gc/shared/space.inline.hpp"
    37 #include "gc/shared/space.inline.hpp"
    38 #include "logging/log.hpp"
    38 #include "logging/log.hpp"
       
    39 #include "logging/logStream.hpp"
    39 #include "memory/iterator.hpp"
    40 #include "memory/iterator.hpp"
    40 #include "memory/resourceArea.hpp"
    41 #include "memory/resourceArea.hpp"
    41 #include "oops/oop.inline.hpp"
    42 #include "oops/oop.inline.hpp"
    42 #include "runtime/atomic.hpp"
    43 #include "runtime/atomic.hpp"
    43 #include "runtime/orderAccess.inline.hpp"
    44 #include "runtime/orderAccess.inline.hpp"
   525         ResourceMark rm;
   526         ResourceMark rm;
   526         if (!_g1h->is_in_closed_subset(obj)) {
   527         if (!_g1h->is_in_closed_subset(obj)) {
   527           HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p);
   528           HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p);
   528           log.error("Field " PTR_FORMAT " of live obj " PTR_FORMAT " in region [" PTR_FORMAT ", " PTR_FORMAT ")",
   529           log.error("Field " PTR_FORMAT " of live obj " PTR_FORMAT " in region [" PTR_FORMAT ", " PTR_FORMAT ")",
   529             p2i(p), p2i(_containing_obj), p2i(from->bottom()), p2i(from->end()));
   530             p2i(p), p2i(_containing_obj), p2i(from->bottom()), p2i(from->end()));
   530           print_object(log.error_stream(), _containing_obj);
   531           LogStream ls(log.error());
       
   532           print_object(&ls, _containing_obj);
   531           log.error("points to obj " PTR_FORMAT " not in the heap", p2i(obj));
   533           log.error("points to obj " PTR_FORMAT " not in the heap", p2i(obj));
   532         } else {
   534         } else {
   533           HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p);
   535           HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p);
   534           HeapRegion* to = _g1h->heap_region_containing((HeapWord*)obj);
   536           HeapRegion* to = _g1h->heap_region_containing((HeapWord*)obj);
   535           log.error("Field " PTR_FORMAT " of live obj " PTR_FORMAT " in region [" PTR_FORMAT ", " PTR_FORMAT ")",
   537           log.error("Field " PTR_FORMAT " of live obj " PTR_FORMAT " in region [" PTR_FORMAT ", " PTR_FORMAT ")",
   536             p2i(p), p2i(_containing_obj), p2i(from->bottom()), p2i(from->end()));
   538             p2i(p), p2i(_containing_obj), p2i(from->bottom()), p2i(from->end()));
   537           print_object(log.error_stream(), _containing_obj);
   539           LogStream ls(log.error());
       
   540           print_object(&ls, _containing_obj);
   538           log.error("points to dead obj " PTR_FORMAT " in region [" PTR_FORMAT ", " PTR_FORMAT ")",
   541           log.error("points to dead obj " PTR_FORMAT " in region [" PTR_FORMAT ", " PTR_FORMAT ")",
   539             p2i(obj), p2i(to->bottom()), p2i(to->end()));
   542             p2i(obj), p2i(to->bottom()), p2i(to->end()));
   540           print_object(log.error_stream(), obj);
   543           print_object(&ls, obj);
   541         }
   544         }
   542         log.error("----------");
   545         log.error("----------");
   543         _failures = true;
   546         _failures = true;
   544         failed = true;
   547         failed = true;
   545         _n_failures++;
   548         _n_failures++;
   591           }
   594           }
   592           log.error("Missing rem set entry:");
   595           log.error("Missing rem set entry:");
   593           log.error("Field " PTR_FORMAT " of obj " PTR_FORMAT ", in region " HR_FORMAT,
   596           log.error("Field " PTR_FORMAT " of obj " PTR_FORMAT ", in region " HR_FORMAT,
   594             p2i(p), p2i(_containing_obj), HR_FORMAT_PARAMS(from));
   597             p2i(p), p2i(_containing_obj), HR_FORMAT_PARAMS(from));
   595           ResourceMark rm;
   598           ResourceMark rm;
   596           _containing_obj->print_on(log.error_stream());
   599           LogStream ls(log.error());
       
   600           _containing_obj->print_on(&ls);
   597           log.error("points to obj " PTR_FORMAT " in region " HR_FORMAT, p2i(obj), HR_FORMAT_PARAMS(to));
   601           log.error("points to obj " PTR_FORMAT " in region " HR_FORMAT, p2i(obj), HR_FORMAT_PARAMS(to));
   598           if (obj->is_oop()) {
   602           if (obj->is_oop()) {
   599             obj->print_on(log.error_stream());
   603             obj->print_on(&ls);
   600           }
   604           }
   601           log.error("Obj head CTE = %d, field CTE = %d.", cv_obj, cv_field);
   605           log.error("Obj head CTE = %d, field CTE = %d.", cv_obj, cv_field);
   602           log.error("----------");
   606           log.error("----------");
   603           _failures = true;
   607           _failures = true;
   604           _n_failures++;
   608           _n_failures++;