mirror of
https://github.com/openjdk/jdk.git
synced 2026-05-14 15:39:45 +00:00
8235696: ZGC: assert(ZNMethod::is_armed(nm) == _should_disarm_nmethods) failed: Invalid state
Reviewed-by: eosterlund, stefank
This commit is contained in:
parent
ad5ea72286
commit
056b70c4b7
@ -32,11 +32,12 @@
|
||||
class nmethod;
|
||||
|
||||
class BarrierSetNMethod: public CHeapObj<mtGC> {
|
||||
bool supports_entry_barrier(nmethod* nm);
|
||||
void deoptimize(nmethod* nm, address* return_addr_ptr);
|
||||
int disarmed_value() const;
|
||||
|
||||
public:
|
||||
bool supports_entry_barrier(nmethod* nm);
|
||||
|
||||
virtual bool nmethod_entry_barrier(nmethod* nm) = 0;
|
||||
virtual ByteSize thread_disarmed_offset() const = 0;
|
||||
virtual int* disarmed_value_address() const = 0;
|
||||
|
||||
@ -187,6 +187,15 @@ void ZNMethod::flush_nmethod(nmethod* nm) {
|
||||
delete gc_data(nm);
|
||||
}
|
||||
|
||||
bool ZNMethod::supports_entry_barrier(nmethod* nm) {
|
||||
BarrierSetNMethod* const bs = BarrierSet::barrier_set()->barrier_set_nmethod();
|
||||
if (bs != NULL) {
|
||||
return bs->supports_entry_barrier(nm);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ZNMethod::is_armed(nmethod* nm) {
|
||||
BarrierSetNMethod* const bs = BarrierSet::barrier_set()->barrier_set_nmethod();
|
||||
if (bs != NULL) {
|
||||
|
||||
@ -43,6 +43,8 @@ public:
|
||||
static void unregister_nmethod(nmethod* nm);
|
||||
static void flush_nmethod(nmethod* nm);
|
||||
|
||||
static bool supports_entry_barrier(nmethod* nm);
|
||||
|
||||
static bool is_armed(nmethod* nm);
|
||||
static void disarm(nmethod* nm);
|
||||
|
||||
|
||||
@ -146,14 +146,15 @@ private:
|
||||
|
||||
public:
|
||||
ZRootsIteratorCodeBlobClosure(ZRootsIteratorClosure* cl) :
|
||||
_cl(cl),
|
||||
_should_disarm_nmethods(cl->should_disarm_nmethods()) {}
|
||||
_cl(cl),
|
||||
_should_disarm_nmethods(cl->should_disarm_nmethods()) {}
|
||||
|
||||
virtual void do_code_blob(CodeBlob* cb) {
|
||||
nmethod* const nm = cb->as_nmethod_or_null();
|
||||
if (nm != NULL && nm->oops_do_try_claim()) {
|
||||
ZNMethod::nmethod_oops_do(nm, _cl);
|
||||
assert(ZNMethod::is_armed(nm) == _should_disarm_nmethods, "Invalid state");
|
||||
assert(!ZNMethod::supports_entry_barrier(nm) ||
|
||||
ZNMethod::is_armed(nm) == _should_disarm_nmethods, "Invalid state");
|
||||
if (_should_disarm_nmethods) {
|
||||
ZNMethod::disarm(nm);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user