Skip to content

Commit 59dcb50

Browse files
committed
8231472: Clean up Monitor::_safepoint_check usage to Mutex::_safepoint_check
Change Monitor:: to Mutex:: when allocating a Mutex, and in mutexLocker. Reviewed-by: rehn, dholmes
1 parent 2f2ec62 commit 59dcb50

File tree

8 files changed

+114
-114
lines changed

8 files changed

+114
-114
lines changed

src/hotspot/share/classfile/classLoaderData.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ void ClassLoaderData::initialize_name(Handle class_loader) {
129129

130130
ClassLoaderData::ClassLoaderData(Handle h_class_loader, bool is_unsafe_anonymous) :
131131
_metaspace(NULL),
132-
_metaspace_lock(new Mutex(Monitor::leaf+1, "Metaspace allocation lock", true,
133-
Monitor::_safepoint_check_never)),
132+
_metaspace_lock(new Mutex(Mutex::leaf+1, "Metaspace allocation lock", true,
133+
Mutex::_safepoint_check_never)),
134134
_unloading(false), _is_unsafe_anonymous(is_unsafe_anonymous),
135135
_modified_oops(true), _accumulated_modified_oops(false),
136136
// An unsafe anonymous class loader data doesn't have anything to keep

src/hotspot/share/gc/g1/g1RootProcessor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ G1RootProcessor::G1RootProcessor(G1CollectedHeap* g1h, uint n_workers) :
7171
_g1h(g1h),
7272
_process_strong_tasks(G1RP_PS_NumElements),
7373
_srs(n_workers),
74-
_lock(Mutex::leaf, "G1 Root Scan barrier lock", false, Monitor::_safepoint_check_never),
74+
_lock(Mutex::leaf, "G1 Root Scan barrier lock", false, Mutex::_safepoint_check_never),
7575
_n_workers_discovered_strong_classes(0) {}
7676

7777
void G1RootProcessor::evacuate_roots(G1ParScanThreadState* pss, uint worker_id) {

src/hotspot/share/gc/g1/heapRegionRemSet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ HeapRegionRemSet::HeapRegionRemSet(G1BlockOffsetTable* bot,
428428
HeapRegion* hr)
429429
: _bot(bot),
430430
_code_roots(),
431-
_m(Mutex::leaf, FormatBuffer<128>("HeapRegionRemSet lock #%u", hr->hrm_index()), true, Monitor::_safepoint_check_never),
431+
_m(Mutex::leaf, FormatBuffer<128>("HeapRegionRemSet lock #%u", hr->hrm_index()), true, Mutex::_safepoint_check_never),
432432
_other_regions(&_m),
433433
_hr(hr),
434434
_state(Untracked)

src/hotspot/share/oops/methodData.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1212,7 +1212,7 @@ void MethodData::post_initialize(BytecodeStream* stream) {
12121212

12131213
// Initialize the MethodData* corresponding to a given method.
12141214
MethodData::MethodData(const methodHandle& method, int size, TRAPS)
1215-
: _extra_data_lock(Monitor::leaf, "MDO extra data lock"),
1215+
: _extra_data_lock(Mutex::leaf, "MDO extra data lock"),
12161216
_parameters_type_data_di(parameters_uninitialized) {
12171217
// Set the method back-pointer.
12181218
_method = method();

src/hotspot/share/oops/methodData.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2011,7 +2011,7 @@ class MethodData : public Metadata {
20112011
MethodData(const methodHandle& method, int size, TRAPS);
20122012
public:
20132013
static MethodData* allocate(ClassLoaderData* loader_data, const methodHandle& method, TRAPS);
2014-
MethodData() : _extra_data_lock(Monitor::leaf, "MDO extra data lock") {}; // For ciMethodData
2014+
MethodData() : _extra_data_lock(Mutex::leaf, "MDO extra data lock") {}; // For ciMethodData
20152015

20162016
bool is_methodData() const volatile { return true; }
20172017
void initialize();

src/hotspot/share/prims/whitebox.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1735,12 +1735,12 @@ WB_ENTRY(jlong, WB_MetaspaceReserveAlignment(JNIEnv* env, jobject wb))
17351735
WB_END
17361736

17371737
WB_ENTRY(void, WB_AssertMatchingSafepointCalls(JNIEnv* env, jobject o, jboolean mutexSafepointValue, jboolean attemptedNoSafepointValue))
1738-
Monitor::SafepointCheckRequired sfpt_check_required = mutexSafepointValue ?
1739-
Monitor::_safepoint_check_always :
1740-
Monitor::_safepoint_check_never;
1741-
Monitor::SafepointCheckFlag sfpt_check_attempted = attemptedNoSafepointValue ?
1742-
Monitor::_no_safepoint_check_flag :
1743-
Monitor::_safepoint_check_flag;
1738+
Mutex::SafepointCheckRequired sfpt_check_required = mutexSafepointValue ?
1739+
Mutex::_safepoint_check_always :
1740+
Mutex::_safepoint_check_never;
1741+
Mutex::SafepointCheckFlag sfpt_check_attempted = attemptedNoSafepointValue ?
1742+
Mutex::_no_safepoint_check_flag :
1743+
Mutex::_safepoint_check_flag;
17441744
MutexLocker ml(new Mutex(Mutex::leaf, "SFPT_Test_lock", true, sfpt_check_required),
17451745
sfpt_check_attempted);
17461746
WB_END

src/hotspot/share/runtime/mutexLocker.cpp

Lines changed: 101 additions & 101 deletions
Large diffs are not rendered by default.

src/hotspot/share/services/memoryManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ GCMemoryManager::GCMemoryManager(const char* name, const char* gc_end_message) :
178178
_num_collections = 0;
179179
_last_gc_stat = NULL;
180180
_last_gc_lock = new Mutex(Mutex::leaf, "_last_gc_lock", true,
181-
Monitor::_safepoint_check_never);
181+
Mutex::_safepoint_check_never);
182182
_current_gc_stat = NULL;
183183
_num_gc_threads = 1;
184184
_notification_enabled = false;

0 commit comments

Comments
 (0)