Commit 3192ef3 1 parent 732d886 commit 3192ef3 Copy full SHA for 3192ef3
File tree 2 files changed +10
-8
lines changed
src/hotspot/share/gc/shenandoah
2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -207,8 +207,7 @@ void ShenandoahNMethod::heal_nmethod(nmethod* nm) {
207
207
}
208
208
209
209
#ifdef ASSERT
210
- void ShenandoahNMethod::assert_alive_and_correct () {
211
- assert (_nm->is_alive (), " only alive nmethods here" );
210
+ void ShenandoahNMethod::assert_correct () {
212
211
ShenandoahHeap* heap = ShenandoahHeap::heap ();
213
212
for (int c = 0 ; c < _oops_count; c++) {
214
213
oop *loc = _oops[c];
@@ -490,14 +489,14 @@ void ShenandoahNMethodTable::log_flush_nmethod(nmethod* nm) {
490
489
}
491
490
492
491
#ifdef ASSERT
493
- void ShenandoahNMethodTable::assert_nmethods_alive_and_correct () {
492
+ void ShenandoahNMethodTable::assert_nmethods_correct () {
494
493
assert_locked_or_safepoint (CodeCache_lock);
495
494
496
495
for (int index = 0 ; index < length (); index ++) {
497
496
ShenandoahNMethod* m = _list->at (index );
498
497
// Concurrent unloading may have dead nmethods to be cleaned by sweeper
499
498
if (m->is_unregistered ()) continue ;
500
- m->assert_alive_and_correct ();
499
+ m->assert_correct ();
501
500
}
502
501
}
503
502
#endif
@@ -563,8 +562,11 @@ void ShenandoahNMethodTableSnapshot::parallel_blobs_do(CodeBlobClosure *f) {
563
562
continue ;
564
563
}
565
564
566
- nmr->assert_alive_and_correct ();
567
- f->do_code_blob (nmr->nm ());
565
+ // A nmethod can become a zombie before it is unregistered.
566
+ if (nmr->nm ()->is_alive ()) {
567
+ nmr->assert_correct ();
568
+ f->do_code_blob (nmr->nm ());
569
+ }
568
570
}
569
571
}
570
572
}
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ class ShenandoahNMethod : public CHeapObj<mtGC> {
73
73
static inline ShenandoahNMethod* gc_data (nmethod* nm);
74
74
static inline void attach_gc_data (nmethod* nm, ShenandoahNMethod* gc_data);
75
75
76
- void assert_alive_and_correct () NOT_DEBUG_RETURN;
76
+ void assert_correct () NOT_DEBUG_RETURN;
77
77
void assert_same_oops (bool allow_dead = false ) NOT_DEBUG_RETURN;
78
78
static void assert_no_oops (nmethod* nm, bool allow_dea = false ) NOT_DEBUG_RETURN;
79
79
@@ -160,7 +160,7 @@ class ShenandoahNMethodTable : public CHeapObj<mtGC> {
160
160
ShenandoahNMethodTableSnapshot* snapshot_for_iteration ();
161
161
void finish_iteration (ShenandoahNMethodTableSnapshot* snapshot);
162
162
163
- void assert_nmethods_alive_and_correct () NOT_DEBUG_RETURN;
163
+ void assert_nmethods_correct () NOT_DEBUG_RETURN;
164
164
private:
165
165
// Rebuild table and replace current one
166
166
void rebuild (int size);
You can’t perform that action at this time.
0 commit comments