104 mark_sweep_phase4(); 105 106 restore_marks(); 107 108 // Set saved marks for allocation profiler (and other things? -- dld) 109 // (Should this be in general part?) 110 gch->save_marks(); 111 112 deallocate_stacks(); 113 114 // If compaction completely evacuated all generations younger than this 115 // one, then we can clear the card table. Otherwise, we must invalidate 116 // it (consider all cards dirty). In the future, we might consider doing 117 // compaction within generations only, and doing card-table sliding. 118 bool all_empty = true; 119 for (int i = 0; all_empty && i < level; i++) { 120 Generation* g = gch->get_gen(i); 121 all_empty = all_empty && gch->get_gen(i)->used() == 0; 122 } 123 GenRemSet* rs = gch->rem_set(); 124 // Clear/invalidate below make use of the "prev_used_regions" saved earlier. 125 if (all_empty) { 126 // We've evacuated all generations below us. 127 Generation* g = gch->get_gen(level); 128 rs->clear_into_younger(g); 129 } else { 130 // Invalidate the cards corresponding to the currently used 131 // region and clear those corresponding to the evacuated region 132 // of all generations just collected. 133 rs->invalidate_or_clear(gch->get_gen(1)); 134 rs->invalidate_or_clear(gch->get_gen(0)); 135 } 136 137 Threads::gc_epilogue(); 138 CodeCache::gc_epilogue(); 139 JvmtiExport::gc_epilogue(); 140 141 if (PrintGC && !PrintGCDetails) { 142 gch->print_heap_change(gch_prev_used); 143 } 144 145 // refs processing: clean slate 146 _ref_processor = NULL; 147 148 // Update heap occupancy information which is used as 149 // input to soft ref clearing policy at the next gc. 150 Universe::update_heap_info_at_gc(); 151 152 // Update time of last gc for all generations we collected 153 // (which curently is all the generations in the heap). 154 // We need to use a monotonically non-deccreasing time in ms | 104 mark_sweep_phase4(); 105 106 restore_marks(); 107 108 // Set saved marks for allocation profiler (and other things? -- dld) 109 // (Should this be in general part?) 110 gch->save_marks(); 111 112 deallocate_stacks(); 113 114 // If compaction completely evacuated all generations younger than this 115 // one, then we can clear the card table. Otherwise, we must invalidate 116 // it (consider all cards dirty). In the future, we might consider doing 117 // compaction within generations only, and doing card-table sliding. 118 bool all_empty = true; 119 for (int i = 0; all_empty && i < level; i++) { 120 Generation* g = gch->get_gen(i); 121 all_empty = all_empty && gch->get_gen(i)->used() == 0; 122 } 123 GenRemSet* rs = gch->rem_set(); 124 Generation* old_gen = gch->get_gen(level); 125 // Clear/invalidate below make use of the "prev_used_regions" saved earlier. 126 if (all_empty) { 127 // We've evacuated all generations below us. 128 rs->clear_into_younger(old_gen); 129 } else { 130 // Invalidate the cards corresponding to the currently used 131 // region and clear those corresponding to the evacuated region 132 // of all generations just collected. 133 rs->invalidate_or_clear(old_gen); 134 } 135 136 Threads::gc_epilogue(); 137 CodeCache::gc_epilogue(); 138 JvmtiExport::gc_epilogue(); 139 140 if (PrintGC && !PrintGCDetails) { 141 gch->print_heap_change(gch_prev_used); 142 } 143 144 // refs processing: clean slate 145 _ref_processor = NULL; 146 147 // Update heap occupancy information which is used as 148 // input to soft ref clearing policy at the next gc. 149 Universe::update_heap_info_at_gc(); 150 151 // Update time of last gc for all generations we collected 152 // (which curently is all the generations in the heap). 153 // We need to use a monotonically non-deccreasing time in ms |