Skip to content

Commit

Permalink
8318585: Rename CodeCache::UnloadingScope to UnlinkingScope
Browse files Browse the repository at this point in the history
Reviewed-by: sgehwolf
Backport-of: 4eab39d9415b2ec5c2984d0d3c110e9364090835
  • Loading branch information
GoeLin committed Apr 10, 2024
1 parent e0d2248 commit 38a2173
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/hotspot/share/code/codeCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ void CodeCache::increment_unloading_cycle() {
}
}

CodeCache::UnloadingScope::UnloadingScope(BoolObjectClosure* is_alive)
CodeCache::UnlinkingScope::UnlinkingScope(BoolObjectClosure* is_alive)
: _is_unloading_behaviour(is_alive)
{
_saved_behaviour = IsUnloadingBehaviour::current();
Expand All @@ -1033,7 +1033,7 @@ CodeCache::UnloadingScope::UnloadingScope(BoolObjectClosure* is_alive)
DependencyContext::cleaning_start();
}

CodeCache::UnloadingScope::~UnloadingScope() {
CodeCache::UnlinkingScope::~UnlinkingScope() {
IsUnloadingBehaviour::set_current(_saved_behaviour);
DependencyContext::cleaning_end();
}
Expand Down
11 changes: 7 additions & 4 deletions src/hotspot/share/code/codeCache.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,17 @@ class CodeCache : AllStatic {

// GC support
static void verify_oops();
// Scope object managing code cache unloading behavior.
class UnloadingScope: StackObj {

// Helper scope object managing code cache unlinking behavior, i.e. sets and
// restores the closure that determines which nmethods are going to be removed
// during the unlinking part of code cache unloading.
class UnlinkingScope : StackObj {
ClosureIsUnloadingBehaviour _is_unloading_behaviour;
IsUnloadingBehaviour* _saved_behaviour;

public:
UnloadingScope(BoolObjectClosure* is_alive);
~UnloadingScope();
UnlinkingScope(BoolObjectClosure* is_alive);
~UnlinkingScope();
};

// Code cache unloading heuristics
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/g1/g1ConcurrentMark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1685,7 +1685,7 @@ void G1ConcurrentMark::weak_refs_work() {
if (ClassUnloadingWithConcurrentMark) {
GCTraceTime(Debug, gc, phases) debug("Class Unloading", _gc_timer_cm);
{
CodeCache::UnloadingScope scope(&g1_is_alive);
CodeCache::UnlinkingScope scope(&g1_is_alive);
bool unloading_occurred = SystemDictionary::do_unloading(_gc_timer_cm);
_g1h->complete_cleaning(unloading_occurred);
}
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/g1/g1FullCollector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ void G1FullCollector::phase1_mark_live_objects() {
if (ClassUnloading) {
GCTraceTime(Debug, gc, phases) debug("Phase 1: Class Unloading and Cleanup", scope()->timer());
{
CodeCache::UnloadingScope unloading_scope(&_is_alive);
CodeCache::UnlinkingScope unloading_scope(&_is_alive);
// Unload classes and purge the SystemDictionary.
bool unloading_occurred = SystemDictionary::do_unloading(scope()->timer());
_heap->complete_cleaning(unloading_occurred);
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/parallel/psParallelCompact.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2055,7 +2055,7 @@ void PSParallelCompact::marking_phase(ParallelOldTracer *gc_tracer) {

bool unloading_occurred;
{
CodeCache::UnloadingScope scope(is_alive_closure());
CodeCache::UnlinkingScope scope(is_alive_closure());

// Follow system dictionary roots and unload classes.
unloading_occurred = SystemDictionary::do_unloading(&_gc_timer);
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/serial/genMarkSweep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ void GenMarkSweep::mark_sweep_phase1(bool clear_all_softrefs) {

bool unloading_occurred;
{
CodeCache::UnloadingScope scope(&is_alive);
CodeCache::UnlinkingScope scope(&is_alive);

// Unload classes and purge the SystemDictionary.
unloading_occurred = SystemDictionary::do_unloading(gc_timer());
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1774,7 +1774,7 @@ void ShenandoahHeap::stw_unload_classes(bool full_gc) {
ShenandoahPhaseTimings::degen_gc_purge_class_unload;
ShenandoahIsAliveSelector is_alive;
{
CodeCache::UnloadingScope scope(is_alive.is_alive_closure());
CodeCache::UnlinkingScope scope(is_alive.is_alive_closure());
ShenandoahGCPhase gc_phase(phase);
ShenandoahGCWorkerPhase worker_phase(phase);
bool unloading_occurred = SystemDictionary::do_unloading(gc_timer());
Expand Down

1 comment on commit 38a2173

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.