Skip to content

Commit 371a0c4

Browse files
committed
8301465: Remove unnecessary nmethod arming in Full GC of Serial/Parallel
Reviewed-by: tschatzl, iwalulya
1 parent 716f1df commit 371a0c4

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

src/hotspot/share/code/codeCache.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,13 @@ class CodeCache : AllStatic {
203203
static uint64_t previous_completed_gc_marking_cycle();
204204
static void on_gc_marking_cycle_start();
205205
static void on_gc_marking_cycle_finish();
206+
// Arm nmethods so that special actions are taken (nmethod_entry_barrier) for
207+
// on-stack nmethods. It's used in two places:
208+
// 1. Used before the start of concurrent marking so that oops inside
209+
// on-stack nmethods are visited.
210+
// 2. Used at the end of (stw/concurrent) marking so that nmethod::_gc_epoch
211+
// is up-to-date, which provides more accurate estimate of
212+
// nmethod::is_cold.
206213
static void arm_all_nmethods();
207214

208215
static void flush_unlinked_nmethods();

src/hotspot/share/gc/parallel/psParallelCompact.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,6 @@ void PSParallelCompact::pre_compact()
962962
heap->increment_total_collections(true);
963963

964964
CodeCache::on_gc_marking_cycle_start();
965-
CodeCache::arm_all_nmethods();
966965

967966
heap->print_heap_before_gc();
968967
heap->trace_heap_before_gc(&_gc_tracer);

src/hotspot/share/gc/shared/genCollectedHeap.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,6 @@ void GenCollectedHeap::do_collection(bool full,
602602
}
603603

604604
CodeCache::on_gc_marking_cycle_start();
605-
CodeCache::arm_all_nmethods();
606605

607606
collect_generation(_old_gen,
608607
full,

0 commit comments

Comments
 (0)