Пример #1
0
void CardTableRS::clear_into_gen_and_younger(Generation* gen) {
  GenCollectedHeap* gch = GenCollectedHeap::heap();
  // Gen and all younger have been evacuated. We can clear
  // remembered set entries for the next highest generation
  // (we know that it has no pointers to younger gens) and
  // those below.
  Generation* g = gch->next_gen(gen);
  while (g != NULL) {
    clear(g->reserved());
    g = gch->prev_gen(gen);
  }
}
Пример #2
0
void CardTableRS::verify() {
  // At present, we only know how to verify the card table RS for
  // generational heaps.
  VerifyCTGenClosure blk(this);
  CollectedHeap* ch = Universe::heap();
  // We will do the perm-gen portion of the card table, too.
  Generation* pg = SharedHeap::heap()->perm_gen();
  HeapWord* pg_boundary = pg->reserved().start();

  if (ch->kind() == CollectedHeap::GenCollectedHeap) {
    GenCollectedHeap::heap()->generation_iterate(&blk, false);
    _ct_bs->verify();

    // If the old gen collections also collect perm, then we are only
    // interested in perm-to-young pointers, not perm-to-old pointers.
    GenCollectedHeap* gch = GenCollectedHeap::heap();
    CollectorPolicy* cp = gch->collector_policy();
    if (cp->is_mark_sweep_policy() || cp->is_concurrent_mark_sweep_policy()) {
      pg_boundary = gch->get_gen(1)->reserved().start();
    }
  }
  VerifyCTSpaceClosure perm_space_blk(this, pg_boundary);
  SharedHeap::heap()->perm_gen()->space_iterate(&perm_space_blk, true);
}