Skip to content

Commit 51fdb4c

Browse files
committedOct 6, 2020
8254075: Shenandoah: Remove ShenandoahCodeRootsStyle diagnostic flag and related test
Reviewed-by: shade
1 parent 77921b9 commit 51fdb4c

File tree

5 files changed

+12
-141
lines changed

5 files changed

+12
-141
lines changed
 

‎src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.cpp

+11-89
Original file line numberDiff line numberDiff line change
@@ -112,50 +112,18 @@ void ShenandoahCodeRoots::initialize() {
112112
}
113113

114114
void ShenandoahCodeRoots::register_nmethod(nmethod* nm) {
115-
switch (ShenandoahCodeRootsStyle) {
116-
case 0:
117-
case 1:
118-
break;
119-
case 2: {
120-
assert_locked_or_safepoint(CodeCache_lock);
121-
_nmethod_table->register_nmethod(nm);
122-
break;
123-
}
124-
default:
125-
ShouldNotReachHere();
126-
}
115+
assert_locked_or_safepoint(CodeCache_lock);
116+
_nmethod_table->register_nmethod(nm);
127117
}
128118

129119
void ShenandoahCodeRoots::unregister_nmethod(nmethod* nm) {
130-
switch (ShenandoahCodeRootsStyle) {
131-
case 0:
132-
case 1: {
133-
break;
134-
}
135-
case 2: {
136-
assert_locked_or_safepoint(CodeCache_lock);
137-
_nmethod_table->unregister_nmethod(nm);
138-
break;
139-
}
140-
default:
141-
ShouldNotReachHere();
142-
}
120+
assert_locked_or_safepoint(CodeCache_lock);
121+
_nmethod_table->unregister_nmethod(nm);
143122
}
144123

145124
void ShenandoahCodeRoots::flush_nmethod(nmethod* nm) {
146-
switch (ShenandoahCodeRootsStyle) {
147-
case 0:
148-
case 1: {
149-
break;
150-
}
151-
case 2: {
152-
assert_locked_or_safepoint(CodeCache_lock);
153-
_nmethod_table->flush_nmethod(nm);
154-
break;
155-
}
156-
default:
157-
ShouldNotReachHere();
158-
}
125+
assert_locked_or_safepoint(CodeCache_lock);
126+
_nmethod_table->flush_nmethod(nm);
159127
}
160128

161129
void ShenandoahCodeRoots::arm_nmethods() {
@@ -389,64 +357,18 @@ ShenandoahCodeRootsIterator::ShenandoahCodeRootsIterator() :
389357
_table_snapshot(NULL) {
390358
assert(SafepointSynchronize::is_at_safepoint(), "Must be at safepoint");
391359
assert(!Thread::current()->is_Worker_thread(), "Should not be acquired by workers");
392-
switch (ShenandoahCodeRootsStyle) {
393-
case 0:
394-
case 1: {
395-
// No need to do anything here
396-
break;
397-
}
398-
case 2: {
399-
CodeCache_lock->lock_without_safepoint_check();
400-
_table_snapshot = ShenandoahCodeRoots::table()->snapshot_for_iteration();
401-
break;
402-
}
403-
default:
404-
ShouldNotReachHere();
405-
}
360+
CodeCache_lock->lock_without_safepoint_check();
361+
_table_snapshot = ShenandoahCodeRoots::table()->snapshot_for_iteration();
406362
}
407363

408364
ShenandoahCodeRootsIterator::~ShenandoahCodeRootsIterator() {
409-
switch (ShenandoahCodeRootsStyle) {
410-
case 0:
411-
case 1: {
412-
// No need to do anything here
413-
break;
414-
}
415-
case 2: {
416-
ShenandoahCodeRoots::table()->finish_iteration(_table_snapshot);
417-
_table_snapshot = NULL;
418-
CodeCache_lock->unlock();
419-
break;
420-
}
421-
default:
422-
ShouldNotReachHere();
423-
}
365+
ShenandoahCodeRoots::table()->finish_iteration(_table_snapshot);
366+
_table_snapshot = NULL;
367+
CodeCache_lock->unlock();
424368
}
425369

426370
void ShenandoahCodeRootsIterator::possibly_parallel_blobs_do(CodeBlobClosure *f) {
427-
switch (ShenandoahCodeRootsStyle) {
428-
case 0: {
429-
if (_seq_claimed.try_set()) {
430-
CodeCache::blobs_do(f);
431-
}
432-
break;
433-
}
434-
case 1: {
435-
_par_iterator.parallel_blobs_do(f);
436-
break;
437-
}
438-
case 2: {
439-
ShenandoahCodeRootsIterator::fast_parallel_blobs_do(f);
440-
break;
441-
}
442-
default:
443-
ShouldNotReachHere();
444-
}
445-
}
446-
447-
void ShenandoahCodeRootsIterator::fast_parallel_blobs_do(CodeBlobClosure *f) {
448371
assert(SafepointSynchronize::is_at_safepoint(), "Must be at safepoint");
449372
assert(_table_snapshot != NULL, "Sanity");
450373
_table_snapshot->parallel_blobs_do(f);
451374
}
452-

‎src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ class ShenandoahCodeRootsIterator {
7878
~ShenandoahCodeRootsIterator();
7979

8080
void possibly_parallel_blobs_do(CodeBlobClosure *f);
81-
void fast_parallel_blobs_do(CodeBlobClosure *f);
8281
};
8382

8483
class ShenandoahCodeRoots : public AllStatic {

‎src/hotspot/share/gc/shenandoah/shenandoahConcurrentRoots.cpp

+1-6
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,7 @@ bool ShenandoahConcurrentRoots::should_do_concurrent_roots() {
3737
}
3838

3939
bool ShenandoahConcurrentRoots::can_do_concurrent_class_unloading() {
40-
#if (defined(X86) || defined(AARCH64))
41-
return ShenandoahCodeRootsStyle == 2 &&
42-
ClassUnloading;
43-
#else
44-
return false;
45-
#endif
40+
return ClassUnloading;
4641
}
4742

4843
bool ShenandoahConcurrentRoots::should_do_concurrent_class_unloading() {

‎src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp

-6
Original file line numberDiff line numberDiff line change
@@ -336,12 +336,6 @@
336336
product(bool, ShenandoahLoadRefBarrier, true, DIAGNOSTIC, \
337337
"Turn on/off load-reference barriers in Shenandoah") \
338338
\
339-
product(uintx, ShenandoahCodeRootsStyle, 2, DIAGNOSTIC, \
340-
"Use this style to scan the code cache roots:" \
341-
" 0 - sequential iterator;" \
342-
" 1 - parallel iterator;" \
343-
" 2 - parallel iterator with cset filters;") \
344-
\
345339
develop(bool, ShenandoahVerifyOptoBarriers, false, \
346340
"Verify no missing barriers in C2.") \
347341
\

‎test/hotspot/jtreg/gc/shenandoah/options/TestCodeCacheRootStyles.java

-39
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.