Skip to content

Commit

Permalink
Merge upstream-jdk
Browse files Browse the repository at this point in the history
  • Loading branch information
corretto-github-robot committed Jun 26, 2024
2 parents 8295237 + d151050 commit 184dcdf
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/shared/gcVMOperations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ bool VM_GC_Operation::doit_prologue() {
void VM_GC_Operation::doit_epilogue() {
// GC thread root traversal likely used OopMapCache a lot, which
// might have created lots of old entries. Trigger the cleanup now.
OopMapCache::trigger_cleanup();
OopMapCache::try_trigger_cleanup();
if (Universe::has_reference_pending_list()) {
Heap_lock->notify_all();
}
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/shenandoah/shenandoahVMOperations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void VM_ShenandoahOperation::doit_epilogue() {
assert(!ShenandoahHeap::heap()->has_gc_state_changed(), "GC State was not synchronized to java threads.");
// GC thread root traversal likely used OopMapCache a lot, which
// might have created lots of old entries. Trigger the cleanup now.
OopMapCache::trigger_cleanup();
OopMapCache::try_trigger_cleanup();
}

bool VM_ShenandoahReferenceOperation::doit_prologue() {
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/x/xDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class VM_XOperation : public VM_Operation {

// GC thread root traversal likely used OopMapCache a lot, which
// might have created lots of old entries. Trigger the cleanup now.
OopMapCache::trigger_cleanup();
OopMapCache::try_trigger_cleanup();
}

bool gc_locked() const {
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/z/zGeneration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ class VM_ZOperation : public VM_Operation {

// GC thread root traversal likely used OopMapCache a lot, which
// might have created lots of old entries. Trigger the cleanup now.
OopMapCache::trigger_cleanup();
OopMapCache::try_trigger_cleanup();
}

bool success() const {
Expand Down
9 changes: 6 additions & 3 deletions src/hotspot/share/interpreter/oopMapCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -592,10 +592,13 @@ bool OopMapCache::has_cleanup_work() {
return Atomic::load(&_old_entries) != nullptr;
}

void OopMapCache::trigger_cleanup() {
if (has_cleanup_work()) {
MutexLocker ml(Service_lock, Mutex::_no_safepoint_check_flag);
void OopMapCache::try_trigger_cleanup() {
// See we can take the lock for the notification without blocking.
// This allows triggering the cleanup from GC paths, that can hold
// the service lock for e.g. oop iteration in service thread.
if (has_cleanup_work() && Service_lock->try_lock_without_rank_check()) {
Service_lock->notify_all();
Service_lock->unlock();
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/interpreter/oopMapCache.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ class OopMapCache : public CHeapObj<mtClass> {
// Check if we need to clean up old entries
static bool has_cleanup_work();

// Request cleanup if work is needed
static void trigger_cleanup();
// Request cleanup if work is needed and notification is currently possible
static void try_trigger_cleanup();

// Clean up the old entries
static void cleanup();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ public class BasicSliderUI extends SliderUI{

/**
* Constructs a {@code BasicSliderUI}.
* @deprecated This constructor was exposed erroneously and will be removed in a future release.
* Use {@link #BasicSliderUI(JSlider)} instead.
*/
@Deprecated(since = "23", forRemoval = true)
public BasicSliderUI() {}

/**
Expand Down

0 comments on commit 184dcdf

Please sign in to comment.