< prev index next >

src/hotspot/share/gc/cms/parOopClosures.inline.hpp

Print this page




  76   assert((!CMSHeap::heap()->is_in_reserved(p) ||
  77           generation()->is_in_reserved(p))
  78          && (CMSHeap::heap()->is_young_gen(generation()) || gc_barrier),
  79          "The gen must be right, and we must be doing the barrier "
  80          "in older generations.");
  81   T heap_oop = RawAccess<>::oop_load(p);
  82   if (!CompressedOops::is_null(heap_oop)) {
  83     oop obj = CompressedOops::decode_not_null(heap_oop);
  84     if ((HeapWord*)obj < _boundary) {
  85 #ifndef PRODUCT
  86       if (_g->to()->is_in_reserved(obj)) {
  87         Log(gc) log;
  88         log.error("Scanning field (" PTR_FORMAT ") twice?", p2i(p));
  89         CMSHeap* heap = CMSHeap::heap();
  90         Space* sp = heap->space_containing(p);
  91         oop obj = oop(sp->block_start(p));
  92         assert((HeapWord*)obj < (HeapWord*)p, "Error");
  93         log.error("Object: " PTR_FORMAT, p2i((void *)obj));
  94         log.error("-------");
  95         LogStream ls(log.error());
  96         obj->print_on(&ls);
  97         log.error("-----");
  98         log.error("Heap:");
  99         log.error("-----");
 100         heap->print_on(&ls);
 101         ShouldNotReachHere();
 102       }
 103 #endif
 104       // OK, we need to ensure that it is copied.
 105       // We read the klass and mark in this order, so that we can reliably
 106       // get the size of the object: if the mark we read is not a
 107       // forwarding pointer, then the klass is valid: the klass is only
 108       // overwritten with an overflow next pointer after the object is
 109       // forwarded.
 110       Klass* objK = obj->klass();
 111       markOop m = obj->mark_raw();
 112       oop new_obj;
 113       if (m->is_marked()) { // Contains forwarding pointer.
 114         new_obj = ParNewGeneration::real_forwardee(obj);
 115         RawAccess<IS_NOT_NULL>::oop_store(p, new_obj);
 116         log_develop_trace(gc, scavenge)("{%s %s ( " PTR_FORMAT " ) " PTR_FORMAT " -> " PTR_FORMAT " (%d)}",




  76   assert((!CMSHeap::heap()->is_in_reserved(p) ||
  77           generation()->is_in_reserved(p))
  78          && (CMSHeap::heap()->is_young_gen(generation()) || gc_barrier),
  79          "The gen must be right, and we must be doing the barrier "
  80          "in older generations.");
  81   T heap_oop = RawAccess<>::oop_load(p);
  82   if (!CompressedOops::is_null(heap_oop)) {
  83     oop obj = CompressedOops::decode_not_null(heap_oop);
  84     if ((HeapWord*)obj < _boundary) {
  85 #ifndef PRODUCT
  86       if (_g->to()->is_in_reserved(obj)) {
  87         Log(gc) log;
  88         log.error("Scanning field (" PTR_FORMAT ") twice?", p2i(p));
  89         CMSHeap* heap = CMSHeap::heap();
  90         Space* sp = heap->space_containing(p);
  91         oop obj = oop(sp->block_start(p));
  92         assert((HeapWord*)obj < (HeapWord*)p, "Error");
  93         log.error("Object: " PTR_FORMAT, p2i((void *)obj));
  94         log.error("-------");
  95         LogStream ls(log.error());
  96         oopDesc::print_on(&ls, obj);
  97         log.error("-----");
  98         log.error("Heap:");
  99         log.error("-----");
 100         heap->print_on(&ls);
 101         ShouldNotReachHere();
 102       }
 103 #endif
 104       // OK, we need to ensure that it is copied.
 105       // We read the klass and mark in this order, so that we can reliably
 106       // get the size of the object: if the mark we read is not a
 107       // forwarding pointer, then the klass is valid: the klass is only
 108       // overwritten with an overflow next pointer after the object is
 109       // forwarded.
 110       Klass* objK = obj->klass();
 111       markOop m = obj->mark_raw();
 112       oop new_obj;
 113       if (m->is_marked()) { // Contains forwarding pointer.
 114         new_obj = ParNewGeneration::real_forwardee(obj);
 115         RawAccess<IS_NOT_NULL>::oop_store(p, new_obj);
 116         log_develop_trace(gc, scavenge)("{%s %s ( " PTR_FORMAT " ) " PTR_FORMAT " -> " PTR_FORMAT " (%d)}",


< prev index next >