Exemplo n.º 1
0
 // Card marks are not precise. The current system can leave us with
 // a mismash of precise marks and beginning of object marks. This means
 // we test for missing precise marks first. If any are found, we don't
 // fail unless the object head is also unmarked.
 virtual void do_object(oop obj) {
   CheckForUnmarkedOops object_check(_young_gen, _card_table);
   obj->oop_iterate(&object_check);
   if (object_check.has_unmarked_oop()) {
     assert(_card_table->addr_is_marked_imprecise(obj), "Found unmarked young_gen object");
   }
 }
Exemplo n.º 2
0
static void mark_object_recursive_skipping_klasses(oop obj) {
  mark_object(obj);
  if (obj != NULL) {
    MarkObjectsSkippingKlassesOopClosure mark_all;
    obj->oop_iterate(&mark_all);
  }
}
Exemplo n.º 3
0
void MarkSweep::track_interior_pointers(oop obj) {
  if (ValidateMarkSweep) {
    _adjusted_pointers->clear();
    _pointer_tracking = true;
    
    AdjusterTracker checker;
    obj->oop_iterate(&checker);
  }
}
Exemplo n.º 4
0
  void do_object(oop obj) {
    obj->oop_iterate_header(&resolve);
    obj->oop_iterate(&resolve);

    assert(obj->klass()->is_shared(), "Klass not pointing into shared space.");

    // If the object is a Java object or class which might (in the
    // future) contain a reference to a young gen object, add it to the
    // list.

    if (obj->is_klass() || obj->is_instance()) {
      if (obj->is_klass() ||
          obj->is_a(SystemDictionary::Class_klass()) ||
          obj->is_a(SystemDictionary::Throwable_klass())) {
        // Do nothing
      }
      else if (obj->is_a(SystemDictionary::String_klass())) {
        // immutable objects.
      } else {
        // someone added an object we hadn't accounted for.
        ShouldNotReachHere();
      }
    }
  }
Exemplo n.º 5
0
 void do_object(oop obj) {
   obj->oop_iterate(&look_in_object);
 }
Exemplo n.º 6
0
void ObjectToOopClosure::do_object(oop obj) {
  obj->oop_iterate(_cl);
}
Exemplo n.º 7
0
  // <original comment>
  // The original idea here was to coalesce evacuated and dead objects.
  // However that caused complications with the block offset table (BOT).
  // In particular if there were two TLABs, one of them partially refined.
  // |----- TLAB_1--------|----TLAB_2-~~~(partially refined part)~~~|
  // The BOT entries of the unrefined part of TLAB_2 point to the start
  // of TLAB_2. If the last object of the TLAB_1 and the first object
  // of TLAB_2 are coalesced, then the cards of the unrefined part
  // would point into middle of the filler object.
  // The current approach is to not coalesce and leave the BOT contents intact.
  // </original comment>
  //
  // We now reset the BOT when we start the object iteration over the
  // region and refine its entries for every object we come across. So
  // the above comment is not really relevant and we should be able
  // to coalesce dead objects if we want to.
  void do_object(oop obj) {
    HeapWord* obj_addr = (HeapWord*) obj;
    assert(_hr->is_in(obj_addr), "sanity");
    size_t obj_size = obj->size();
    HeapWord* obj_end = obj_addr + obj_size;

    if (_end_of_last_gap != obj_addr) {
      // there was a gap before obj_addr
      _last_gap_threshold = _hr->cross_threshold(_end_of_last_gap, obj_addr);
    }

    if (obj->is_forwarded() && obj->forwardee() == obj) {
      // The object failed to move.

      // We consider all objects that we find self-forwarded to be
      // live. What we'll do is that we'll update the prev marking
      // info so that they are all under PTAMS and explicitly marked.
      if (!_cm->isPrevMarked(obj)) {
        _cm->markPrev(obj);
      }
      if (_during_initial_mark) {
        // For the next marking info we'll only mark the
        // self-forwarded objects explicitly if we are during
        // initial-mark (since, normally, we only mark objects pointed
        // to by roots if we succeed in copying them). By marking all
        // self-forwarded objects we ensure that we mark any that are
        // still pointed to be roots. During concurrent marking, and
        // after initial-mark, we don't need to mark any objects
        // explicitly and all objects in the CSet are considered
        // (implicitly) live. So, we won't mark them explicitly and
        // we'll leave them over NTAMS.
        _cm->grayRoot(obj, obj_size, _worker_id, _hr);
      }
      _marked_bytes += (obj_size * HeapWordSize);
      obj->set_mark(markOopDesc::prototype());

      // While we were processing RSet buffers during the collection,
      // we actually didn't scan any cards on the collection set,
      // since we didn't want to update remembered sets with entries
      // that point into the collection set, given that live objects
      // from the collection set are about to move and such entries
      // will be stale very soon.
      // This change also dealt with a reliability issue which
      // involved scanning a card in the collection set and coming
      // across an array that was being chunked and looking malformed.
      // The problem is that, if evacuation fails, we might have
      // remembered set entries missing given that we skipped cards on
      // the collection set. So, we'll recreate such entries now.
      obj->oop_iterate(_update_rset_cl);
    } else {

      // The object has been either evacuated or is dead. Fill it with a
      // dummy object.
      MemRegion mr(obj_addr, obj_size);
      CollectedHeap::fill_with_object(mr);

      // must nuke all dead objects which we skipped when iterating over the region
      _cm->clearRangePrevBitmap(MemRegion(_end_of_last_gap, obj_end));
    }
    _end_of_last_gap = obj_end;
    _last_obj_threshold = _hr->cross_threshold(obj_addr, obj_end);
  }
Exemplo n.º 8
0
 void do_object(oop obj) {
   obj->oop_iterate(_update_rs_oop_cl);
 }