< prev index next >
src/share/vm/gc/shared/gcLocker.cpp
Print this page
rev 12310 : [mq]: gcinterface.patch
*** 133,143 ****
_doing_gc = true;
{
// Must give up the lock while at a safepoint
MutexUnlocker munlock(JNICritical_lock);
log_debug_jni("Performing GC after exiting critical section.");
! Universe::heap()->collect(GCCause::_gc_locker);
}
_doing_gc = false;
_needs_gc = false;
JNICritical_lock->notify_all();
}
--- 133,143 ----
_doing_gc = true;
{
// Must give up the lock while at a safepoint
MutexUnlocker munlock(JNICritical_lock);
log_debug_jni("Performing GC after exiting critical section.");
! GC::gc()->heap()->collect(GCCause::_gc_locker);
}
_doing_gc = false;
_needs_gc = false;
JNICritical_lock->notify_all();
}
*** 148,167 ****
#ifdef ASSERT
NoGCVerifier::NoGCVerifier(bool verifygc) {
_verifygc = verifygc;
if (_verifygc) {
! CollectedHeap* h = Universe::heap();
assert(!h->is_gc_active(), "GC active during NoGCVerifier");
_old_invocations = h->total_collections();
}
}
NoGCVerifier::~NoGCVerifier() {
if (_verifygc) {
! CollectedHeap* h = Universe::heap();
assert(!h->is_gc_active(), "GC active during NoGCVerifier");
if (_old_invocations != h->total_collections()) {
fatal("collection in a NoGCVerifier secured function");
}
}
--- 148,167 ----
#ifdef ASSERT
NoGCVerifier::NoGCVerifier(bool verifygc) {
_verifygc = verifygc;
if (_verifygc) {
! CollectedHeap* h = GC::gc()->heap();
assert(!h->is_gc_active(), "GC active during NoGCVerifier");
_old_invocations = h->total_collections();
}
}
NoGCVerifier::~NoGCVerifier() {
if (_verifygc) {
! CollectedHeap* h = GC::gc()->heap();
assert(!h->is_gc_active(), "GC active during NoGCVerifier");
if (_old_invocations != h->total_collections()) {
fatal("collection in a NoGCVerifier secured function");
}
}
*** 170,180 ****
PauseNoGCVerifier::PauseNoGCVerifier(NoGCVerifier * ngcv) {
_ngcv = ngcv;
if (_ngcv->_verifygc) {
// if we were verifying, then make sure that nothing is
// wrong before we "pause" verification
! CollectedHeap* h = Universe::heap();
assert(!h->is_gc_active(), "GC active during NoGCVerifier");
if (_ngcv->_old_invocations != h->total_collections()) {
fatal("collection in a NoGCVerifier secured function");
}
}
--- 170,180 ----
PauseNoGCVerifier::PauseNoGCVerifier(NoGCVerifier * ngcv) {
_ngcv = ngcv;
if (_ngcv->_verifygc) {
// if we were verifying, then make sure that nothing is
// wrong before we "pause" verification
! CollectedHeap* h = GC::gc()->heap();
assert(!h->is_gc_active(), "GC active during NoGCVerifier");
if (_ngcv->_old_invocations != h->total_collections()) {
fatal("collection in a NoGCVerifier secured function");
}
}
*** 182,192 ****
PauseNoGCVerifier::~PauseNoGCVerifier() {
if (_ngcv->_verifygc) {
// if we were verifying before, then reenable verification
! CollectedHeap* h = Universe::heap();
assert(!h->is_gc_active(), "GC active during NoGCVerifier");
_ngcv->_old_invocations = h->total_collections();
}
}
--- 182,192 ----
PauseNoGCVerifier::~PauseNoGCVerifier() {
if (_ngcv->_verifygc) {
// if we were verifying before, then reenable verification
! CollectedHeap* h = GC::gc()->heap();
assert(!h->is_gc_active(), "GC active during NoGCVerifier");
_ngcv->_old_invocations = h->total_collections();
}
}
< prev index next >