8278627: Shenandoah: TestHeapDump test failed
Reviewed-by: shade, rkennke
This commit is contained in:
parent
54517fa3d8
commit
1128674d7f
@ -227,7 +227,7 @@ ShenandoahCodeBlobAndDisarmClosure::ShenandoahCodeBlobAndDisarmClosure(OopClosur
|
|||||||
|
|
||||||
void ShenandoahCodeBlobAndDisarmClosure::do_code_blob(CodeBlob* cb) {
|
void ShenandoahCodeBlobAndDisarmClosure::do_code_blob(CodeBlob* cb) {
|
||||||
nmethod* const nm = cb->as_nmethod_or_null();
|
nmethod* const nm = cb->as_nmethod_or_null();
|
||||||
if (nm != NULL && nm->oops_do_try_claim()) {
|
if (nm != NULL) {
|
||||||
assert(!ShenandoahNMethod::gc_data(nm)->is_unregistered(), "Should not be here");
|
assert(!ShenandoahNMethod::gc_data(nm)->is_unregistered(), "Should not be here");
|
||||||
CodeBlobToOopClosure::do_code_blob(cb);
|
CodeBlobToOopClosure::do_code_blob(cb);
|
||||||
_bs->disarm(nm);
|
_bs->disarm(nm);
|
||||||
|
@ -79,7 +79,6 @@ ShenandoahThreadRoots::~ShenandoahThreadRoots() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ShenandoahCodeCacheRoots::ShenandoahCodeCacheRoots(ShenandoahPhaseTimings::Phase phase) : _phase(phase) {
|
ShenandoahCodeCacheRoots::ShenandoahCodeCacheRoots(ShenandoahPhaseTimings::Phase phase) : _phase(phase) {
|
||||||
nmethod::oops_do_marking_prologue();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShenandoahCodeCacheRoots::code_blobs_do(CodeBlobClosure* blob_cl, uint worker_id) {
|
void ShenandoahCodeCacheRoots::code_blobs_do(CodeBlobClosure* blob_cl, uint worker_id) {
|
||||||
@ -87,10 +86,6 @@ void ShenandoahCodeCacheRoots::code_blobs_do(CodeBlobClosure* blob_cl, uint work
|
|||||||
_coderoots_iterator.possibly_parallel_blobs_do(blob_cl);
|
_coderoots_iterator.possibly_parallel_blobs_do(blob_cl);
|
||||||
}
|
}
|
||||||
|
|
||||||
ShenandoahCodeCacheRoots::~ShenandoahCodeCacheRoots() {
|
|
||||||
nmethod::oops_do_marking_epilogue();
|
|
||||||
}
|
|
||||||
|
|
||||||
ShenandoahRootProcessor::ShenandoahRootProcessor(ShenandoahPhaseTimings::Phase phase) :
|
ShenandoahRootProcessor::ShenandoahRootProcessor(ShenandoahPhaseTimings::Phase phase) :
|
||||||
_heap(ShenandoahHeap::heap()),
|
_heap(ShenandoahHeap::heap()),
|
||||||
_phase(phase),
|
_phase(phase),
|
||||||
@ -258,12 +253,35 @@ ShenandoahHeapIterationRootScanner::ShenandoahHeapIterationRootScanner(uint n_wo
|
|||||||
_code_roots(ShenandoahPhaseTimings::heap_iteration_roots) {
|
_code_roots(ShenandoahPhaseTimings::heap_iteration_roots) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class ShenandoahMarkCodeBlobClosure : public CodeBlobClosure {
|
||||||
|
private:
|
||||||
|
OopClosure* const _oops;
|
||||||
|
BarrierSetNMethod* const _bs_nm;
|
||||||
|
|
||||||
|
public:
|
||||||
|
ShenandoahMarkCodeBlobClosure(OopClosure* oops) :
|
||||||
|
_oops(oops),
|
||||||
|
_bs_nm(BarrierSet::barrier_set()->barrier_set_nmethod()) {}
|
||||||
|
|
||||||
|
virtual void do_code_blob(CodeBlob* cb) {
|
||||||
|
nmethod* const nm = cb->as_nmethod_or_null();
|
||||||
|
if (nm != nullptr) {
|
||||||
|
if (_bs_nm != nullptr) {
|
||||||
|
// Make sure it only sees to-space objects
|
||||||
|
_bs_nm->nmethod_entry_barrier(nm);
|
||||||
|
}
|
||||||
|
ShenandoahNMethod* const snm = ShenandoahNMethod::gc_data(nm);
|
||||||
|
assert(snm != nullptr, "Sanity");
|
||||||
|
snm->oops_do(_oops, false /*fix_relocations*/);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
void ShenandoahHeapIterationRootScanner::roots_do(OopClosure* oops) {
|
void ShenandoahHeapIterationRootScanner::roots_do(OopClosure* oops) {
|
||||||
// Must use _claim_other to avoid interfering with concurrent CLDG iteration
|
// Must use _claim_other to avoid interfering with concurrent CLDG iteration
|
||||||
CLDToOopClosure clds(oops, ClassLoaderData::_claim_other);
|
CLDToOopClosure clds(oops, ClassLoaderData::_claim_other);
|
||||||
MarkingCodeBlobClosure code(oops, !CodeBlobToOopClosure::FixRelocations);
|
ShenandoahMarkCodeBlobClosure code(oops);
|
||||||
ShenandoahParallelOopsDoThreadClosure tc_cl(oops, &code, NULL);
|
ShenandoahParallelOopsDoThreadClosure tc_cl(oops, &code, NULL);
|
||||||
AlwaysTrueClosure always_true;
|
|
||||||
|
|
||||||
ResourceMark rm;
|
ResourceMark rm;
|
||||||
|
|
||||||
|
@ -102,7 +102,6 @@ private:
|
|||||||
ShenandoahCodeRootsIterator _coderoots_iterator;
|
ShenandoahCodeRootsIterator _coderoots_iterator;
|
||||||
public:
|
public:
|
||||||
ShenandoahCodeCacheRoots(ShenandoahPhaseTimings::Phase phase);
|
ShenandoahCodeCacheRoots(ShenandoahPhaseTimings::Phase phase);
|
||||||
~ShenandoahCodeCacheRoots();
|
|
||||||
|
|
||||||
void code_blobs_do(CodeBlobClosure* blob_cl, uint worker_id);
|
void code_blobs_do(CodeBlobClosure* blob_cl, uint worker_id);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user