src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
Print this page
rev 6796 : [mq]: templateOopIterate
rev 6801 : imported patch defaultToTrue
*** 31,40 ****
--- 31,41 ----
#include "gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.hpp"
#include "gc_implementation/concurrentMarkSweep/cmsOopClosures.inline.hpp"
#include "gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp"
#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.inline.hpp"
#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp"
+ #include "gc_implementation/concurrentMarkSweep/promotionInfo.inline.hpp"
#include "gc_implementation/concurrentMarkSweep/vmCMSOperations.hpp"
#include "gc_implementation/parNew/parNewGeneration.hpp"
#include "gc_implementation/shared/collectorCounters.hpp"
#include "gc_implementation/shared/gcTimer.hpp"
#include "gc_implementation/shared/gcTrace.hpp"
*** 50,59 ****
--- 51,61 ----
#include "memory/genOopClosures.inline.hpp"
#include "memory/iterator.inline.hpp"
#include "memory/padded.hpp"
#include "memory/referencePolicy.hpp"
#include "memory/resourceArea.hpp"
+ #include "memory/space.inline.hpp"
#include "memory/tenuredGeneration.hpp"
#include "oops/oop.inline.hpp"
#include "prims/jvmtiExport.hpp"
#include "runtime/atomic.inline.hpp"
#include "runtime/globals_extension.hpp"
*** 198,208 ****
ConcurrentMarkSweepGeneration::ConcurrentMarkSweepGeneration(
ReservedSpace rs, size_t initial_byte_size, int level,
CardTableRS* ct, bool use_adaptive_freelists,
FreeBlockDictionary<FreeChunk>::DictionaryChoice dictionaryChoice) :
! CardGeneration(rs, initial_byte_size, level, ct),
_dilatation_factor(((double)MinChunkSize)/((double)(CollectedHeap::min_fill_size()))),
_debug_collection_type(Concurrent_collection_type),
_did_compact(false)
{
HeapWord* bottom = (HeapWord*) _virtual_space.low();
--- 200,210 ----
ConcurrentMarkSweepGeneration::ConcurrentMarkSweepGeneration(
ReservedSpace rs, size_t initial_byte_size, int level,
CardTableRS* ct, bool use_adaptive_freelists,
FreeBlockDictionary<FreeChunk>::DictionaryChoice dictionaryChoice) :
! CardGeneration(rs, initial_byte_size, level, ct, _dispatch_index_generation_cms),
_dilatation_factor(((double)MinChunkSize)/((double)(CollectedHeap::min_fill_size()))),
_debug_collection_type(Concurrent_collection_type),
_did_compact(false)
{
HeapWord* bottom = (HeapWord*) _virtual_space.low();
*** 1438,1453 ****
par_promote_alloc_done(int thread_num) {
CMSParGCThreadState* ps = _par_gc_thread_states[thread_num];
ps->lab.retire(thread_num);
}
void
ConcurrentMarkSweepGeneration::
par_oop_since_save_marks_iterate_done(int thread_num) {
CMSParGCThreadState* ps = _par_gc_thread_states[thread_num];
ParScanWithoutBarrierClosure* dummy_cl = NULL;
! ps->promo.promoted_oops_iterate_nv(dummy_cl);
}
bool ConcurrentMarkSweepGeneration::should_collect(bool full,
size_t size,
bool tlab)
--- 1440,1458 ----
par_promote_alloc_done(int thread_num) {
CMSParGCThreadState* ps = _par_gc_thread_states[thread_num];
ps->lab.retire(thread_num);
}
+ // SSS: Temporary include
+ #include "gc_implementation/parNew/parOopClosures.inline.hpp"
+
void
ConcurrentMarkSweepGeneration::
par_oop_since_save_marks_iterate_done(int thread_num) {
CMSParGCThreadState* ps = _par_gc_thread_states[thread_num];
ParScanWithoutBarrierClosure* dummy_cl = NULL;
! ps->promo.promoted_oops_iterate<false>(dummy_cl);
}
bool ConcurrentMarkSweepGeneration::should_collect(bool full,
size_t size,
bool tlab)
*** 3118,3139 ****
bool ConcurrentMarkSweepGeneration::no_allocs_since_save_marks() {
return cmsSpace()->no_allocs_since_save_marks();
}
- #define CMS_SINCE_SAVE_MARKS_DEFN(OopClosureType, nv_suffix) \
- \
- void ConcurrentMarkSweepGeneration:: \
- oop_since_save_marks_iterate##nv_suffix(OopClosureType* cl) { \
- cl->set_generation(this); \
- cmsSpace()->oop_since_save_marks_iterate##nv_suffix(cl); \
- cl->reset_generation(); \
- save_marks(); \
- }
-
- ALL_SINCE_SAVE_MARKS_CLOSURES(CMS_SINCE_SAVE_MARKS_DEFN)
-
void
ConcurrentMarkSweepGeneration::younger_refs_iterate(OopsInGenClosure* cl) {
cl->set_generation(this);
younger_refs_in_space_iterate(_cmsSpace, cl);
cl->reset_generation();
--- 3123,3132 ----
*** 4211,4221 ****
oop new_oop;
if (_work_queue->pop_local(new_oop)) {
assert(new_oop->is_oop(), "Should be an oop");
assert(_bit_map->isMarked((HeapWord*)new_oop), "Grey object");
assert(_span.contains((HeapWord*)new_oop), "Not in span");
! new_oop->oop_iterate(this); // do_oop() above
do_yield_check();
}
}
}
--- 4204,4215 ----
oop new_oop;
if (_work_queue->pop_local(new_oop)) {
assert(new_oop->is_oop(), "Should be an oop");
assert(_bit_map->isMarked((HeapWord*)new_oop), "Grey object");
assert(_span.contains((HeapWord*)new_oop), "Not in span");
! // SSS: Opportunity to devirtualize
! new_oop->oop_iterate<false>(this); // do_oop() above
do_yield_check();
}
}
}
*** 4251,4261 ****
// assert(work_q->size() > 0, "Work from overflow stack");
continue;
} else if (task_queues()->steal(i, seed, /* reference */ obj_to_scan)) {
assert(obj_to_scan->is_oop(), "Should be an oop");
assert(bm->isMarked((HeapWord*)obj_to_scan), "Grey object");
! obj_to_scan->oop_iterate(&cl);
} else if (terminator()->offer_termination(&_term_term)) {
assert(work_q->size() == 0, "Impossible!");
break;
} else if (yielding() || should_yield()) {
yield();
--- 4245,4256 ----
// assert(work_q->size() > 0, "Work from overflow stack");
continue;
} else if (task_queues()->steal(i, seed, /* reference */ obj_to_scan)) {
assert(obj_to_scan->is_oop(), "Should be an oop");
assert(bm->isMarked((HeapWord*)obj_to_scan), "Grey object");
! // SSS: Opportunity to devirtualize
! obj_to_scan->oop_iterate<false>(&cl);
} else if (terminator()->offer_termination(&_term_term)) {
assert(work_q->size() == 0, "Impossible!");
break;
} else if (yielding() || should_yield()) {
yield();
*** 5432,5442 ****
assert(mr.is_empty() || space->used_region().contains(mr),
"Should be in space");
// Verify that "start" is an object boundary
assert(mr.is_empty() || oop(mr.start())->is_oop(),
"Should be an oop");
! space->par_oop_iterate(mr, cl);
}
pst->all_tasks_completed();
}
}
--- 5427,5437 ----
assert(mr.is_empty() || space->used_region().contains(mr),
"Should be in space");
// Verify that "start" is an object boundary
assert(mr.is_empty() || oop(mr.start())->is_oop(),
"Should be an oop");
! space->par_oop_iterate<false>(mr, cl);
}
pst->all_tasks_completed();
}
}
*** 6068,6078 ****
if (task_queues()->steal(i, seed, /* reference */ obj_to_scan)) {
NOT_PRODUCT(num_steals++;)
assert(obj_to_scan->is_oop(), "Oops, not an oop!");
assert(_mark_bit_map->isMarked((HeapWord*)obj_to_scan), "Stole an unmarked oop?");
// Do scanning work
! obj_to_scan->oop_iterate(keep_alive);
// Loop around, finish this work, and try to steal some more
} else if (terminator()->offer_termination()) {
break; // nirvana from the infinite cycle
}
}
--- 6063,6074 ----
if (task_queues()->steal(i, seed, /* reference */ obj_to_scan)) {
NOT_PRODUCT(num_steals++;)
assert(obj_to_scan->is_oop(), "Oops, not an oop!");
assert(_mark_bit_map->isMarked((HeapWord*)obj_to_scan), "Stole an unmarked oop?");
// Do scanning work
! // SSS: Opportunity to devirtualize
! obj_to_scan->oop_iterate<false>(keep_alive);
// Loop around, finish this work, and try to steal some more
} else if (terminator()->offer_termination()) {
break; // nirvana from the infinite cycle
}
}
*** 7629,7639 ****
assert(res, "Empty non-zero size stack should have space for single push");
while (!_mark_stack->isEmpty()) {
oop new_oop = _mark_stack->pop();
assert(new_oop->is_oop(), "Oops! expected to pop an oop");
// now scan this oop's oops
! new_oop->oop_iterate(&_pam_verify_closure);
}
assert(_mark_stack->isEmpty(), "tautology, emphasizing post-condition");
return true;
}
--- 7625,7636 ----
assert(res, "Empty non-zero size stack should have space for single push");
while (!_mark_stack->isEmpty()) {
oop new_oop = _mark_stack->pop();
assert(new_oop->is_oop(), "Oops! expected to pop an oop");
// now scan this oop's oops
! // SSS: This is not devirtualized, opportunity to fix?
! new_oop->oop_iterate<false>(&_pam_verify_closure);
}
assert(_mark_stack->isEmpty(), "tautology, emphasizing post-condition");
return true;
}