mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8219687: G1 asserts nmethod should not be unloaded during parallel code cache unloading
Reviewed-by: tschatzl, kvn
This commit is contained in:
parent
1dd6e7a3eb
commit
ec5bfaba53
4 changed files with 5 additions and 6 deletions
|
@ -1774,10 +1774,9 @@ void nmethod::do_unloading(bool unloading_occurred) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void nmethod::oops_do(OopClosure* f, bool allow_zombie) {
|
void nmethod::oops_do(OopClosure* f, bool allow_dead) {
|
||||||
// make sure the oops ready to receive visitors
|
// make sure the oops ready to receive visitors
|
||||||
assert(allow_zombie || !is_zombie(), "should not call follow on zombie nmethod");
|
assert(allow_dead || is_alive(), "should not call follow on dead nmethod");
|
||||||
assert(!is_unloaded(), "should not call follow on unloaded nmethod");
|
|
||||||
|
|
||||||
// Prevent extra code cache walk for platforms that don't have immediate oops.
|
// Prevent extra code cache walk for platforms that don't have immediate oops.
|
||||||
if (relocInfo::mustIterateImmediateOopsInCode()) {
|
if (relocInfo::mustIterateImmediateOopsInCode()) {
|
||||||
|
|
|
@ -473,7 +473,7 @@ public:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void oops_do(OopClosure* f) { oops_do(f, false); }
|
void oops_do(OopClosure* f) { oops_do(f, false); }
|
||||||
void oops_do(OopClosure* f, bool allow_zombie);
|
void oops_do(OopClosure* f, bool allow_dead);
|
||||||
|
|
||||||
bool test_set_oops_do_mark();
|
bool test_set_oops_do_mark();
|
||||||
static void oops_do_marking_prologue();
|
static void oops_do_marking_prologue();
|
||||||
|
|
|
@ -64,7 +64,7 @@ public:
|
||||||
bool ClosureIsUnloadingBehaviour::is_unloading(CompiledMethod* cm) const {
|
bool ClosureIsUnloadingBehaviour::is_unloading(CompiledMethod* cm) const {
|
||||||
if (cm->is_nmethod()) {
|
if (cm->is_nmethod()) {
|
||||||
IsCompiledMethodUnloadingOopClosure cl(_cl);
|
IsCompiledMethodUnloadingOopClosure cl(_cl);
|
||||||
static_cast<nmethod*>(cm)->oops_do(&cl);
|
static_cast<nmethod*>(cm)->oops_do(&cl, true /* allow_dead */);
|
||||||
return cl.is_unloading();
|
return cl.is_unloading();
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -170,7 +170,7 @@ void ShenandoahCodeRoots::remove_nmethod(nmethod* nm) {
|
||||||
ShenandoahLocker locker(CodeCache_lock->owned_by_self() ? NULL : &_recorded_nms_lock);
|
ShenandoahLocker locker(CodeCache_lock->owned_by_self() ? NULL : &_recorded_nms_lock);
|
||||||
|
|
||||||
ShenandoahNMethodOopDetector detector;
|
ShenandoahNMethodOopDetector detector;
|
||||||
nm->oops_do(&detector, /* allow_zombie = */ true);
|
nm->oops_do(&detector, /* allow_dead = */ true);
|
||||||
|
|
||||||
if (detector.has_oops()) {
|
if (detector.has_oops()) {
|
||||||
int idx = _recorded_nms->find(nm, ShenandoahNMethod::find_with_nmethod);
|
int idx = _recorded_nms->find(nm, ShenandoahNMethod::find_with_nmethod);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue