Skip to content
Permalink
Browse files

8234662: Sweeper should keep current nmethod alive before yielding fo…

…r ICStub refills

Reviewed-by: pliden, stefank
  • Loading branch information
fisk committed Dec 3, 2019
1 parent 03521f4 commit 22ea33cf7a8d964fedb93e479ad22dc49cb897bf
Showing with 14 additions and 3 deletions.
  1. +13 −0 src/hotspot/share/code/compiledMethod.cpp
  2. +1 −3 src/hotspot/share/gc/shared/barrierSetNMethod.hpp
@@ -30,6 +30,7 @@
#include "code/codeCache.hpp"
#include "code/icBuffer.hpp"
#include "gc/shared/barrierSet.hpp"
#include "gc/shared/barrierSetNMethod.hpp"
#include "gc/shared/gcBehaviours.hpp"
#include "interpreter/bytecode.inline.hpp"
#include "logging/log.hpp"
@@ -556,6 +557,18 @@ void CompiledMethod::cleanup_inline_caches(bool clean_all) {
return;
}
}
BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod();
if (bs_nm != NULL) {
// We want to keep an invariant that nmethods found through iterations of a Thread's
// nmethods found in safepoints have gone through an entry barrier and are not armed.
// By calling this nmethod entry barrier from the sweeper, it plays along and acts
// like any other nmethod found on the stack of a thread (fewer surprises).
nmethod* nm = as_nmethod_or_null();
if (nm != NULL) {
bool alive = bs_nm->nmethod_entry_barrier(nm);
assert(alive, "should be alive");
}
}
InlineCacheBuffer::refill_ic_stubs();
}
}
@@ -36,10 +36,8 @@ class BarrierSetNMethod: public CHeapObj<mtGC> {
void deoptimize(nmethod* nm, address* return_addr_ptr);
int disarmed_value() const;

protected:
virtual bool nmethod_entry_barrier(nmethod* nm) = 0;

public:
virtual bool nmethod_entry_barrier(nmethod* nm) = 0;
virtual ByteSize thread_disarmed_offset() const = 0;
virtual int* disarmed_value_address() const = 0;

0 comments on commit 22ea33c

Please sign in to comment.
You can’t perform that action at this time.