@@ -112,50 +112,18 @@ void ShenandoahCodeRoots::initialize() {
112
112
}
113
113
114
114
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);
127
117
}
128
118
129
119
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);
143
122
}
144
123
145
124
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);
159
127
}
160
128
161
129
void ShenandoahCodeRoots::arm_nmethods () {
@@ -389,64 +357,18 @@ ShenandoahCodeRootsIterator::ShenandoahCodeRootsIterator() :
389
357
_table_snapshot(NULL ) {
390
358
assert (SafepointSynchronize::is_at_safepoint (), " Must be at safepoint" );
391
359
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 ();
406
362
}
407
363
408
364
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 ();
424
368
}
425
369
426
370
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) {
448
371
assert (SafepointSynchronize::is_at_safepoint (), " Must be at safepoint" );
449
372
assert (_table_snapshot != NULL , " Sanity" );
450
373
_table_snapshot->parallel_blobs_do (f);
451
374
}
452
-
0 commit comments