Skip to content
Permalink
Browse files
8254075: Shenandoah: Remove ShenandoahCodeRootsStyle diagnostic flag …
…and related test

Reviewed-by: shade
  • Loading branch information
zhengyu123 committed Oct 6, 2020
1 parent 77921b9 commit 51fdb4c0392aee5d817765d59cb6b9ec27f0050b
Showing 5 changed files with 12 additions and 141 deletions.
@@ -112,50 +112,18 @@ void ShenandoahCodeRoots::initialize() {
}

void ShenandoahCodeRoots::register_nmethod(nmethod* nm) {
switch (ShenandoahCodeRootsStyle) {
case 0:
case 1:
break;
case 2: {
assert_locked_or_safepoint(CodeCache_lock);
_nmethod_table->register_nmethod(nm);
break;
}
default:
ShouldNotReachHere();
}
assert_locked_or_safepoint(CodeCache_lock);
_nmethod_table->register_nmethod(nm);
}

void ShenandoahCodeRoots::unregister_nmethod(nmethod* nm) {
switch (ShenandoahCodeRootsStyle) {
case 0:
case 1: {
break;
}
case 2: {
assert_locked_or_safepoint(CodeCache_lock);
_nmethod_table->unregister_nmethod(nm);
break;
}
default:
ShouldNotReachHere();
}
assert_locked_or_safepoint(CodeCache_lock);
_nmethod_table->unregister_nmethod(nm);
}

void ShenandoahCodeRoots::flush_nmethod(nmethod* nm) {
switch (ShenandoahCodeRootsStyle) {
case 0:
case 1: {
break;
}
case 2: {
assert_locked_or_safepoint(CodeCache_lock);
_nmethod_table->flush_nmethod(nm);
break;
}
default:
ShouldNotReachHere();
}
assert_locked_or_safepoint(CodeCache_lock);
_nmethod_table->flush_nmethod(nm);
}

void ShenandoahCodeRoots::arm_nmethods() {
@@ -389,64 +357,18 @@ ShenandoahCodeRootsIterator::ShenandoahCodeRootsIterator() :
_table_snapshot(NULL) {
assert(SafepointSynchronize::is_at_safepoint(), "Must be at safepoint");
assert(!Thread::current()->is_Worker_thread(), "Should not be acquired by workers");
switch (ShenandoahCodeRootsStyle) {
case 0:
case 1: {
// No need to do anything here
break;
}
case 2: {
CodeCache_lock->lock_without_safepoint_check();
_table_snapshot = ShenandoahCodeRoots::table()->snapshot_for_iteration();
break;
}
default:
ShouldNotReachHere();
}
CodeCache_lock->lock_without_safepoint_check();
_table_snapshot = ShenandoahCodeRoots::table()->snapshot_for_iteration();
}

ShenandoahCodeRootsIterator::~ShenandoahCodeRootsIterator() {
switch (ShenandoahCodeRootsStyle) {
case 0:
case 1: {
// No need to do anything here
break;
}
case 2: {
ShenandoahCodeRoots::table()->finish_iteration(_table_snapshot);
_table_snapshot = NULL;
CodeCache_lock->unlock();
break;
}
default:
ShouldNotReachHere();
}
ShenandoahCodeRoots::table()->finish_iteration(_table_snapshot);
_table_snapshot = NULL;
CodeCache_lock->unlock();
}

void ShenandoahCodeRootsIterator::possibly_parallel_blobs_do(CodeBlobClosure *f) {
switch (ShenandoahCodeRootsStyle) {
case 0: {
if (_seq_claimed.try_set()) {
CodeCache::blobs_do(f);
}
break;
}
case 1: {
_par_iterator.parallel_blobs_do(f);
break;
}
case 2: {
ShenandoahCodeRootsIterator::fast_parallel_blobs_do(f);
break;
}
default:
ShouldNotReachHere();
}
}

void ShenandoahCodeRootsIterator::fast_parallel_blobs_do(CodeBlobClosure *f) {
assert(SafepointSynchronize::is_at_safepoint(), "Must be at safepoint");
assert(_table_snapshot != NULL, "Sanity");
_table_snapshot->parallel_blobs_do(f);
}

@@ -78,7 +78,6 @@ class ShenandoahCodeRootsIterator {
~ShenandoahCodeRootsIterator();

void possibly_parallel_blobs_do(CodeBlobClosure *f);
void fast_parallel_blobs_do(CodeBlobClosure *f);
};

class ShenandoahCodeRoots : public AllStatic {
@@ -37,12 +37,7 @@ bool ShenandoahConcurrentRoots::should_do_concurrent_roots() {
}

bool ShenandoahConcurrentRoots::can_do_concurrent_class_unloading() {
#if (defined(X86) || defined(AARCH64))
return ShenandoahCodeRootsStyle == 2 &&
ClassUnloading;
#else
return false;
#endif
return ClassUnloading;
}

bool ShenandoahConcurrentRoots::should_do_concurrent_class_unloading() {
@@ -336,12 +336,6 @@
product(bool, ShenandoahLoadRefBarrier, true, DIAGNOSTIC, \
"Turn on/off load-reference barriers in Shenandoah") \
\
product(uintx, ShenandoahCodeRootsStyle, 2, DIAGNOSTIC, \
"Use this style to scan the code cache roots:" \
" 0 - sequential iterator;" \
" 1 - parallel iterator;" \
" 2 - parallel iterator with cset filters;") \
\
develop(bool, ShenandoahVerifyOptoBarriers, false, \
"Verify no missing barriers in C2.") \
\

This file was deleted.

1 comment on commit 51fdb4c

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented on 51fdb4c Oct 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.