< prev index next >
src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp
Print this page
rev 8068 : imported patch parallelscavenge_cleanup
*** 85,96 ****
MutableSpace* _to_space;
PSPromotionManager* _promotion_manager;
public:
PSKeepAliveClosure(PSPromotionManager* pm) : _promotion_manager(pm) {
! ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap();
! assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity");
_to_space = heap->young_gen()->to_space();
assert(_promotion_manager != NULL, "Sanity");
}
--- 85,95 ----
MutableSpace* _to_space;
PSPromotionManager* _promotion_manager;
public:
PSKeepAliveClosure(PSPromotionManager* pm) : _promotion_manager(pm) {
! ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
_to_space = heap->young_gen()->to_space();
assert(_promotion_manager != NULL, "Sanity");
}
*** 216,230 ****
// Note that this method should only be called from the vm_thread while
// at a safepoint!
bool PSScavenge::invoke() {
assert(SafepointSynchronize::is_at_safepoint(), "should be at safepoint");
assert(Thread::current() == (Thread*)VMThread::vm_thread(), "should be in vm thread");
! assert(!Universe::heap()->is_gc_active(), "not reentrant");
!
! ParallelScavengeHeap* const heap = (ParallelScavengeHeap*)Universe::heap();
! assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity");
PSAdaptiveSizePolicy* policy = heap->size_policy();
IsGCActiveMark mark;
const bool scavenge_done = PSScavenge::invoke_no_policy();
const bool need_full_gc = !scavenge_done ||
--- 215,227 ----
// Note that this method should only be called from the vm_thread while
// at a safepoint!
bool PSScavenge::invoke() {
assert(SafepointSynchronize::is_at_safepoint(), "should be at safepoint");
assert(Thread::current() == (Thread*)VMThread::vm_thread(), "should be in vm thread");
! assert(!ParallelScavengeHeap::heap()->is_gc_active(), "not reentrant");
+ ParallelScavengeHeap* const heap = ParallelScavengeHeap::heap();
PSAdaptiveSizePolicy* policy = heap->size_policy();
IsGCActiveMark mark;
const bool scavenge_done = PSScavenge::invoke_no_policy();
const bool need_full_gc = !scavenge_done ||
*** 271,283 ****
if (GC_locker::check_active_before_gc()) {
return false;
}
! ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap();
GCCause::Cause gc_cause = heap->gc_cause();
- assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity");
// Check for potential problems.
if (!should_attempt_scavenge()) {
return false;
}
--- 268,279 ----
if (GC_locker::check_active_before_gc()) {
return false;
}
! ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
GCCause::Cause gc_cause = heap->gc_cause();
// Check for potential problems.
if (!should_attempt_scavenge()) {
return false;
}
*** 711,723 ****
// This method iterates over all objects in the young generation,
// unforwarding markOops. It then restores any preserved mark oops,
// and clears the _preserved_mark_stack.
void PSScavenge::clean_up_failed_promotion() {
! ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap();
! assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity");
!
PSYoungGen* young_gen = heap->young_gen();
{
ResourceMark rm;
--- 707,717 ----
// This method iterates over all objects in the young generation,
// unforwarding markOops. It then restores any preserved mark oops,
// and clears the _preserved_mark_stack.
void PSScavenge::clean_up_failed_promotion() {
! ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
PSYoungGen* young_gen = heap->young_gen();
{
ResourceMark rm;
*** 740,750 ****
_preserved_mark_stack.clear(true);
_preserved_oop_stack.clear(true);
}
// Reset the PromotionFailureALot counters.
! NOT_PRODUCT(Universe::heap()->reset_promotion_should_fail();)
}
// This method is called whenever an attempt to promote an object
// fails. Some markOops will need preservation, some will not. Note
// that the entire eden is traversed after a failed promotion, with
--- 734,744 ----
_preserved_mark_stack.clear(true);
_preserved_oop_stack.clear(true);
}
// Reset the PromotionFailureALot counters.
! NOT_PRODUCT(heap->reset_promotion_should_fail();)
}
// This method is called whenever an attempt to promote an object
// fails. Some markOops will need preservation, some will not. Note
// that the entire eden is traversed after a failed promotion, with
*** 759,770 ****
_preserved_mark_stack.push(obj_mark);
}
}
bool PSScavenge::should_attempt_scavenge() {
! ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap();
! assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity");
PSGCAdaptivePolicyCounters* counters = heap->gc_policy_counters();
if (UsePerfData) {
counters->update_scavenge_skipped(not_skipped);
}
--- 753,763 ----
_preserved_mark_stack.push(obj_mark);
}
}
bool PSScavenge::should_attempt_scavenge() {
! ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
PSGCAdaptivePolicyCounters* counters = heap->gc_policy_counters();
if (UsePerfData) {
counters->update_scavenge_skipped(not_skipped);
}
*** 836,848 ****
// We want to smooth out our startup times for the AdaptiveSizePolicy
_tenuring_threshold = (UseAdaptiveSizePolicy) ? InitialTenuringThreshold :
MaxTenuringThreshold;
}
! ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap();
! assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity");
!
PSYoungGen* young_gen = heap->young_gen();
PSOldGen* old_gen = heap->old_gen();
// Set boundary between young_gen and old_gen
assert(old_gen->reserved().end() <= young_gen->eden_space()->bottom(),
--- 829,839 ----
// We want to smooth out our startup times for the AdaptiveSizePolicy
_tenuring_threshold = (UseAdaptiveSizePolicy) ? InitialTenuringThreshold :
MaxTenuringThreshold;
}
! ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
PSYoungGen* young_gen = heap->young_gen();
PSOldGen* old_gen = heap->old_gen();
// Set boundary between young_gen and old_gen
assert(old_gen->reserved().end() <= young_gen->eden_space()->bottom(),
< prev index next >