< prev index next >
src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.cpp
Print this page
rev 7780 : imported patch 8072621
rev 7781 : imported patch 8066771
rev 7782 : [mq]: review
*** 30,55 ****
#include "gc_implementation/parallelScavenge/vmPSOperations.hpp"
#include "memory/gcLocker.inline.hpp"
#include "utilities/dtrace.hpp"
// The following methods are used by the parallel scavenge collector
! VM_ParallelGCFailedAllocation::VM_ParallelGCFailedAllocation(size_t size,
uint gc_count) :
! VM_GC_Operation(gc_count, GCCause::_allocation_failure),
! _size(size),
! _result(NULL)
! {
}
void VM_ParallelGCFailedAllocation::doit() {
SvcGCMarker sgcm(SvcGCMarker::MINOR);
ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap();
assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "must be a ParallelScavengeHeap");
GCCauseSetter gccs(heap, _gc_cause);
! _result = heap->failed_mem_allocate(_size);
if (_result == NULL && GC_locker::is_active_and_needs_gc()) {
set_gc_locked();
}
}
--- 30,53 ----
#include "gc_implementation/parallelScavenge/vmPSOperations.hpp"
#include "memory/gcLocker.inline.hpp"
#include "utilities/dtrace.hpp"
// The following methods are used by the parallel scavenge collector
! VM_ParallelGCFailedAllocation::VM_ParallelGCFailedAllocation(size_t word_size,
uint gc_count) :
! VM_CollectForAllocation(word_size, gc_count, GCCause::_allocation_failure) {
! assert(word_size != 0, "An allocation should always be requested with this operation.");
}
void VM_ParallelGCFailedAllocation::doit() {
SvcGCMarker sgcm(SvcGCMarker::MINOR);
ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap();
assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "must be a ParallelScavengeHeap");
GCCauseSetter gccs(heap, _gc_cause);
! _result = heap->failed_mem_allocate(_word_size);
if (_result == NULL && GC_locker::is_active_and_needs_gc()) {
set_gc_locked();
}
}
< prev index next >