< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahAsserts.cpp

Print this page
rev 50076 : Fold Partial GC into Traversal GC


  11  * version 2 for more details (a copy is included in the LICENSE file that
  12  * accompanied this code).
  13  *
  14  * You should have received a copy of the GNU General Public License version
  15  * 2 along with this work; if not, write to the Free Software Foundation,
  16  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  17  *
  18  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  19  * or visit www.oracle.com if you need additional information or have any
  20  * questions.
  21  *
  22  */
  23 
  24 #include "precompiled.hpp"
  25 
  26 #include "gc/shenandoah/brooksPointer.hpp"
  27 #include "gc/shenandoah/shenandoahConnectionMatrix.hpp"
  28 #include "gc/shenandoah/shenandoahAsserts.hpp"
  29 #include "gc/shenandoah/shenandoahHeap.hpp"
  30 #include "gc/shenandoah/shenandoahHeap.inline.hpp"


  31 #include "memory/resourceArea.hpp"
  32 
  33 void ShenandoahAsserts::print_obj(ShenandoahMessageBuffer& msg, oop obj) {
  34   ShenandoahHeap* heap = ShenandoahHeap::heap();
  35   ShenandoahHeapRegion *r = heap->heap_region_containing(obj);
  36 
  37   ResourceMark rm;
  38   stringStream ss;
  39   r->print_on(&ss);
  40 
  41   msg.append("  " PTR_FORMAT " - klass " PTR_FORMAT " %s\n", p2i(obj), p2i(obj->klass()), obj->klass()->external_name());
  42   msg.append("    %3s allocated after complete mark start\n", heap->allocated_after_complete_mark_start((HeapWord *) obj) ? "" : "not");
  43   msg.append("    %3s allocated after next mark start\n",     heap->allocated_after_next_mark_start((HeapWord *) obj)     ? "" : "not");
  44   msg.append("    %3s marked complete\n",      heap->is_marked_complete(obj) ? "" : "not");
  45   msg.append("    %3s marked next\n",          heap->is_marked_next(obj) ? "" : "not");
  46   msg.append("    %3s in collection set\n",    heap->in_collection_set(obj) ? "" : "not");




  47   msg.append("  region: %s", ss.as_string());
  48 }
  49 
  50 void ShenandoahAsserts::print_non_obj(ShenandoahMessageBuffer& msg, void* loc) {
  51   ShenandoahHeap* heap = ShenandoahHeap::heap();
  52   if (heap->is_in(loc)) {
  53     msg.append("  inside Java heap\n");
  54     ShenandoahHeapRegion *r = heap->heap_region_containing(loc);
  55     stringStream ss;
  56     r->print_on(&ss);
  57 
  58     msg.append("    %3s in collection set\n",    heap->in_collection_set(loc) ? "" : "not");
  59     msg.append("  region: %s", ss.as_string());
  60   } else {
  61     msg.append("  outside of Java heap\n");
  62     stringStream ss;
  63     os::print_location(&ss, (intptr_t) loc, false);
  64     msg.append("  %s", ss.as_string());
  65   }
  66 }




  11  * version 2 for more details (a copy is included in the LICENSE file that
  12  * accompanied this code).
  13  *
  14  * You should have received a copy of the GNU General Public License version
  15  * 2 along with this work; if not, write to the Free Software Foundation,
  16  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  17  *
  18  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  19  * or visit www.oracle.com if you need additional information or have any
  20  * questions.
  21  *
  22  */
  23 
  24 #include "precompiled.hpp"
  25 
  26 #include "gc/shenandoah/brooksPointer.hpp"
  27 #include "gc/shenandoah/shenandoahConnectionMatrix.hpp"
  28 #include "gc/shenandoah/shenandoahAsserts.hpp"
  29 #include "gc/shenandoah/shenandoahHeap.hpp"
  30 #include "gc/shenandoah/shenandoahHeap.inline.hpp"
  31 #include "gc/shenandoah/shenandoahHeapRegionSet.inline.hpp"
  32 #include "gc/shenandoah/shenandoahTraversalGC.hpp"
  33 #include "memory/resourceArea.hpp"
  34 
  35 void ShenandoahAsserts::print_obj(ShenandoahMessageBuffer& msg, oop obj) {
  36   ShenandoahHeap* heap = ShenandoahHeap::heap();
  37   ShenandoahHeapRegion *r = heap->heap_region_containing(obj);
  38 
  39   ResourceMark rm;
  40   stringStream ss;
  41   r->print_on(&ss);
  42 
  43   msg.append("  " PTR_FORMAT " - klass " PTR_FORMAT " %s\n", p2i(obj), p2i(obj->klass()), obj->klass()->external_name());
  44   msg.append("    %3s allocated after complete mark start\n", heap->allocated_after_complete_mark_start((HeapWord *) obj) ? "" : "not");
  45   msg.append("    %3s allocated after next mark start\n",     heap->allocated_after_next_mark_start((HeapWord *) obj)     ? "" : "not");
  46   msg.append("    %3s marked complete\n",      heap->is_marked_complete(obj) ? "" : "not");
  47   msg.append("    %3s marked next\n",          heap->is_marked_next(obj) ? "" : "not");
  48   msg.append("    %3s in collection set\n",    heap->in_collection_set(obj) ? "" : "not");
  49   if (heap->traversal_gc() != NULL) {
  50     msg.append("    %3s in root set\n",        heap->traversal_gc()->root_regions()->is_in((HeapWord*) obj) ? "" : "not");
  51     msg.append("    %3s in traversal set\n",   heap->traversal_gc()->traversal_set()->is_in((HeapWord*) obj) ? "" : "not");
  52   }
  53   msg.append("  region: %s", ss.as_string());
  54 }
  55 
  56 void ShenandoahAsserts::print_non_obj(ShenandoahMessageBuffer& msg, void* loc) {
  57   ShenandoahHeap* heap = ShenandoahHeap::heap();
  58   if (heap->is_in(loc)) {
  59     msg.append("  inside Java heap\n");
  60     ShenandoahHeapRegion *r = heap->heap_region_containing(loc);
  61     stringStream ss;
  62     r->print_on(&ss);
  63 
  64     msg.append("    %3s in collection set\n",    heap->in_collection_set(loc) ? "" : "not");
  65     msg.append("  region: %s", ss.as_string());
  66   } else {
  67     msg.append("  outside of Java heap\n");
  68     stringStream ss;
  69     os::print_location(&ss, (intptr_t) loc, false);
  70     msg.append("  %s", ss.as_string());
  71   }
  72 }


< prev index next >