src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp

changeset 809
a4b729f5b611
parent 704
850fdf70db2b
child 810
81cd571500b0
     1.1 --- a/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp	Sat Sep 27 00:33:13 2008 -0700
     1.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp	Tue Sep 30 11:49:31 2008 -0700
     1.3 @@ -100,93 +100,6 @@
     1.4  GrowableArray<size_t>   * PSParallelCompact::_last_gc_live_oops_size = NULL;
     1.5  #endif
     1.6  
     1.7 -// XXX beg - verification code; only works while we also mark in object headers
     1.8 -static void
     1.9 -verify_mark_bitmap(ParMarkBitMap& _mark_bitmap)
    1.10 -{
    1.11 -  ParallelScavengeHeap* heap = PSParallelCompact::gc_heap();
    1.12 -
    1.13 -  PSPermGen* perm_gen = heap->perm_gen();
    1.14 -  PSOldGen* old_gen = heap->old_gen();
    1.15 -  PSYoungGen* young_gen = heap->young_gen();
    1.16 -
    1.17 -  MutableSpace* perm_space = perm_gen->object_space();
    1.18 -  MutableSpace* old_space = old_gen->object_space();
    1.19 -  MutableSpace* eden_space = young_gen->eden_space();
    1.20 -  MutableSpace* from_space = young_gen->from_space();
    1.21 -  MutableSpace* to_space = young_gen->to_space();
    1.22 -
    1.23 -  // 'from_space' here is the survivor space at the lower address.
    1.24 -  if (to_space->bottom() < from_space->bottom()) {
    1.25 -    from_space = to_space;
    1.26 -    to_space = young_gen->from_space();
    1.27 -  }
    1.28 -
    1.29 -  HeapWord* boundaries[12];
    1.30 -  unsigned int bidx = 0;
    1.31 -  const unsigned int bidx_max = sizeof(boundaries) / sizeof(boundaries[0]);
    1.32 -
    1.33 -  boundaries[0] = perm_space->bottom();
    1.34 -  boundaries[1] = perm_space->top();
    1.35 -  boundaries[2] = old_space->bottom();
    1.36 -  boundaries[3] = old_space->top();
    1.37 -  boundaries[4] = eden_space->bottom();
    1.38 -  boundaries[5] = eden_space->top();
    1.39 -  boundaries[6] = from_space->bottom();
    1.40 -  boundaries[7] = from_space->top();
    1.41 -  boundaries[8] = to_space->bottom();
    1.42 -  boundaries[9] = to_space->top();
    1.43 -  boundaries[10] = to_space->end();
    1.44 -  boundaries[11] = to_space->end();
    1.45 -
    1.46 -  BitMap::idx_t beg_bit = 0;
    1.47 -  BitMap::idx_t end_bit;
    1.48 -  BitMap::idx_t tmp_bit;
    1.49 -  const BitMap::idx_t last_bit = _mark_bitmap.size();
    1.50 -  do {
    1.51 -    HeapWord* addr = _mark_bitmap.bit_to_addr(beg_bit);
    1.52 -    if (_mark_bitmap.is_marked(beg_bit)) {
    1.53 -      oop obj = (oop)addr;
    1.54 -      assert(obj->is_gc_marked(), "obj header is not marked");
    1.55 -      end_bit = _mark_bitmap.find_obj_end(beg_bit, last_bit);
    1.56 -      const size_t size = _mark_bitmap.obj_size(beg_bit, end_bit);
    1.57 -      assert(size == (size_t)obj->size(), "end bit wrong?");
    1.58 -      beg_bit = _mark_bitmap.find_obj_beg(beg_bit + 1, last_bit);
    1.59 -      assert(beg_bit > end_bit, "bit set in middle of an obj");
    1.60 -    } else {
    1.61 -      if (addr >= boundaries[bidx] && addr < boundaries[bidx + 1]) {
    1.62 -        // a dead object in the current space.
    1.63 -        oop obj = (oop)addr;
    1.64 -        end_bit = _mark_bitmap.addr_to_bit(addr + obj->size());
    1.65 -        assert(!obj->is_gc_marked(), "obj marked in header, not in bitmap");
    1.66 -        tmp_bit = beg_bit + 1;
    1.67 -        beg_bit = _mark_bitmap.find_obj_beg(tmp_bit, end_bit);
    1.68 -        assert(beg_bit == end_bit, "beg bit set in unmarked obj");
    1.69 -        beg_bit = _mark_bitmap.find_obj_end(tmp_bit, end_bit);
    1.70 -        assert(beg_bit == end_bit, "end bit set in unmarked obj");
    1.71 -      } else if (addr < boundaries[bidx + 2]) {
    1.72 -        // addr is between top in the current space and bottom in the next.
    1.73 -        end_bit = beg_bit + pointer_delta(boundaries[bidx + 2], addr);
    1.74 -        tmp_bit = beg_bit;
    1.75 -        beg_bit = _mark_bitmap.find_obj_beg(tmp_bit, end_bit);
    1.76 -        assert(beg_bit == end_bit, "beg bit set above top");
    1.77 -        beg_bit = _mark_bitmap.find_obj_end(tmp_bit, end_bit);
    1.78 -        assert(beg_bit == end_bit, "end bit set above top");
    1.79 -        bidx += 2;
    1.80 -      } else if (bidx < bidx_max - 2) {
    1.81 -        bidx += 2; // ???
    1.82 -      } else {
    1.83 -        tmp_bit = beg_bit;
    1.84 -        beg_bit = _mark_bitmap.find_obj_beg(tmp_bit, last_bit);
    1.85 -        assert(beg_bit == last_bit, "beg bit set outside heap");
    1.86 -        beg_bit = _mark_bitmap.find_obj_end(tmp_bit, last_bit);
    1.87 -        assert(beg_bit == last_bit, "end bit set outside heap");
    1.88 -      }
    1.89 -    }
    1.90 -  } while (beg_bit < last_bit);
    1.91 -}
    1.92 -// XXX end - verification code; only works while we also mark in object headers
    1.93 -
    1.94  #ifndef PRODUCT
    1.95  const char* PSParallelCompact::space_names[] = {
    1.96    "perm", "old ", "eden", "from", "to  "
    1.97 @@ -1584,11 +1497,6 @@
    1.98    // trace("2");
    1.99  
   1.100  #ifdef  ASSERT
   1.101 -  if (VerifyParallelOldWithMarkSweep  &&
   1.102 -      (PSParallelCompact::total_invocations() %
   1.103 -         VerifyParallelOldWithMarkSweepInterval) == 0) {
   1.104 -    verify_mark_bitmap(_mark_bitmap);
   1.105 -  }
   1.106    if (TraceParallelOldGCMarkingPhase) {
   1.107      tty->print_cr("add_obj_count=" SIZE_FORMAT " "
   1.108                    "add_obj_bytes=" SIZE_FORMAT,
   1.109 @@ -2038,39 +1946,9 @@
   1.110      }
   1.111  #endif  // #ifndef PRODUCT
   1.112  
   1.113 -#ifdef ASSERT
   1.114 -    if (VerifyParallelOldWithMarkSweep &&
   1.115 -        (PSParallelCompact::total_invocations() %
   1.116 -           VerifyParallelOldWithMarkSweepInterval) == 0) {
   1.117 -      gclog_or_tty->print_cr("Verify marking with mark_sweep_phase1()");
   1.118 -      if (PrintGCDetails && Verbose) {
   1.119 -        gclog_or_tty->print_cr("mark_sweep_phase1:");
   1.120 -      }
   1.121 -      // Clear the discovered lists so that discovered objects
   1.122 -      // don't look like they have been discovered twice.
   1.123 -      ref_processor()->clear_discovered_references();
   1.124 -
   1.125 -      PSMarkSweep::allocate_stacks();
   1.126 -      MemRegion mr = Universe::heap()->reserved_region();
   1.127 -      PSMarkSweep::ref_processor()->enable_discovery();
   1.128 -      PSMarkSweep::mark_sweep_phase1(maximum_heap_compaction);
   1.129 -    }
   1.130 -#endif
   1.131 -
   1.132      bool max_on_system_gc = UseMaximumCompactionOnSystemGC && is_system_gc;
   1.133      summary_phase(vmthread_cm, maximum_heap_compaction || max_on_system_gc);
   1.134  
   1.135 -#ifdef ASSERT
   1.136 -    if (VerifyParallelOldWithMarkSweep &&
   1.137 -        (PSParallelCompact::total_invocations() %
   1.138 -           VerifyParallelOldWithMarkSweepInterval) == 0) {
   1.139 -      if (PrintGCDetails && Verbose) {
   1.140 -        gclog_or_tty->print_cr("mark_sweep_phase2:");
   1.141 -      }
   1.142 -      PSMarkSweep::mark_sweep_phase2();
   1.143 -    }
   1.144 -#endif
   1.145 -
   1.146      COMPILER2_PRESENT(assert(DerivedPointerTable::is_active(), "Sanity"));
   1.147      COMPILER2_PRESENT(DerivedPointerTable::set_active(false));
   1.148  
   1.149 @@ -2078,28 +1956,6 @@
   1.150      // needed by the compaction for filling holes in the dense prefix.
   1.151      adjust_roots();
   1.152  
   1.153 -#ifdef ASSERT
   1.154 -    if (VerifyParallelOldWithMarkSweep &&
   1.155 -        (PSParallelCompact::total_invocations() %
   1.156 -           VerifyParallelOldWithMarkSweepInterval) == 0) {
   1.157 -      // Do a separate verify phase so that the verify
   1.158 -      // code can use the the forwarding pointers to
   1.159 -      // check the new pointer calculation.  The restore_marks()
   1.160 -      // has to be done before the real compact.
   1.161 -      vmthread_cm->set_action(ParCompactionManager::VerifyUpdate);
   1.162 -      compact_perm(vmthread_cm);
   1.163 -      compact_serial(vmthread_cm);
   1.164 -      vmthread_cm->set_action(ParCompactionManager::ResetObjects);
   1.165 -      compact_perm(vmthread_cm);
   1.166 -      compact_serial(vmthread_cm);
   1.167 -      vmthread_cm->set_action(ParCompactionManager::UpdateAndCopy);
   1.168 -
   1.169 -      // For debugging only
   1.170 -      PSMarkSweep::restore_marks();
   1.171 -      PSMarkSweep::deallocate_stacks();
   1.172 -    }
   1.173 -#endif
   1.174 -
   1.175      compaction_start.update();
   1.176      // Does the perm gen always have to be done serially because
   1.177      // klasses are used in the update of an object?

mercurial