This repository was archived by the owner on Feb 2, 2023. It is now read-only.
Commit 9bf30f7 authored and committed Feb 10, 2021
1 parent a42820a commit 9bf30f7 Copy full SHA for 9bf30f7
File tree 2 files changed +14
-1
lines changed
2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 30
30
#include " code/codeCache.hpp"
31
31
#include " code/icBuffer.hpp"
32
32
#include " gc/shared/barrierSet.hpp"
33
+ #include " gc/shared/barrierSetNMethod.hpp"
33
34
#include " gc/shared/gcBehaviours.hpp"
34
35
#include " interpreter/bytecode.inline.hpp"
35
36
#include " logging/log.hpp"
@@ -535,6 +536,18 @@ void CompiledMethod::cleanup_inline_caches(bool clean_all) {
535
536
return ;
536
537
}
537
538
}
539
+ BarrierSetNMethod* bs_nm = BarrierSet::barrier_set ()->barrier_set_nmethod ();
540
+ if (bs_nm != NULL ) {
541
+ // We want to keep an invariant that nmethods found through iterations of a Thread's
542
+ // nmethods found in safepoints have gone through an entry barrier and are not armed.
543
+ // By calling this nmethod entry barrier from the sweeper, it plays along and acts
544
+ // like any other nmethod found on the stack of a thread (fewer surprises).
545
+ nmethod* nm = as_nmethod_or_null ();
546
+ if (nm != NULL ) {
547
+ bool alive = bs_nm->nmethod_entry_barrier (nm);
548
+ assert (alive, " should be alive" );
549
+ }
550
+ }
538
551
InlineCacheBuffer::refill_ic_stubs ();
539
552
}
540
553
}
Original file line number Diff line number Diff line change @@ -37,9 +37,9 @@ class BarrierSetNMethod: public CHeapObj<mtGC> {
37
37
38
38
protected:
39
39
virtual int disarmed_value () const ;
40
- virtual bool nmethod_entry_barrier (nmethod* nm) = 0;
41
40
42
41
public:
42
+ virtual bool nmethod_entry_barrier (nmethod* nm) = 0;
43
43
virtual ByteSize thread_disarmed_offset () const = 0;
44
44
45
45
static int nmethod_stub_entry_barrier (address* return_address_ptr);
You can’t perform that action at this time.
1 commit comments
openjdk-notifier[bot] commentedon Feb 10, 2021
Review
Issues