8301465: Remove unnecessary nmethod arming in Full GC of Serial/Parallel

Reviewed-by: tschatzl, iwalulya
This commit is contained in:
Albert Mingkun Yang 2023-02-06 11:36:29 +00:00
parent 716f1df609
commit 371a0c4f88
3 changed files with 7 additions and 2 deletions

View File

@ -203,6 +203,13 @@ class CodeCache : AllStatic {
static uint64_t previous_completed_gc_marking_cycle();
static void on_gc_marking_cycle_start();
static void on_gc_marking_cycle_finish();
// Arm nmethods so that special actions are taken (nmethod_entry_barrier) for
// on-stack nmethods. It's used in two places:
// 1. Used before the start of concurrent marking so that oops inside
// on-stack nmethods are visited.
// 2. Used at the end of (stw/concurrent) marking so that nmethod::_gc_epoch
// is up-to-date, which provides more accurate estimate of
// nmethod::is_cold.
static void arm_all_nmethods();
static void flush_unlinked_nmethods();

View File

@ -962,7 +962,6 @@ void PSParallelCompact::pre_compact()
heap->increment_total_collections(true);
CodeCache::on_gc_marking_cycle_start();
CodeCache::arm_all_nmethods();
heap->print_heap_before_gc();
heap->trace_heap_before_gc(&_gc_tracer);

View File

@ -602,7 +602,6 @@ void GenCollectedHeap::do_collection(bool full,
}
CodeCache::on_gc_marking_cycle_start();
CodeCache::arm_all_nmethods();
collect_generation(_old_gen,
full,