1 /*
2 * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
56 Mutex* ExpandHeap_lock = NULL;
57 Mutex* AdapterHandlerLibrary_lock = NULL;
58 Mutex* SignatureHandlerLibrary_lock = NULL;
59 Mutex* VtableStubs_lock = NULL;
60 Mutex* SymbolArena_lock = NULL;
61 Monitor* StringDedupQueue_lock = NULL;
62 Mutex* StringDedupTable_lock = NULL;
63 Monitor* CodeCache_lock = NULL;
64 Mutex* MethodData_lock = NULL;
65 Mutex* TouchedMethodLog_lock = NULL;
66 Mutex* RetData_lock = NULL;
67 Monitor* VMOperationQueue_lock = NULL;
68 Monitor* VMOperationRequest_lock = NULL;
69 Monitor* Threads_lock = NULL;
70 Mutex* NonJavaThreadsList_lock = NULL;
71 Mutex* NonJavaThreadsListSync_lock = NULL;
72 Monitor* CGC_lock = NULL;
73 Monitor* STS_lock = NULL;
74 Monitor* FullGCCount_lock = NULL;
75 Monitor* G1OldGCCount_lock = NULL;
76 Monitor* DirtyCardQ_CBL_mon = NULL;
77 Mutex* Shared_DirtyCardQ_lock = NULL;
78 Mutex* MarkStackFreeList_lock = NULL;
79 Mutex* MarkStackChunkList_lock = NULL;
80 Mutex* MonitoringSupport_lock = NULL;
81 Mutex* ParGCRareEvent_lock = NULL;
82 Monitor* CGCPhaseManager_lock = NULL;
83 Mutex* Compile_lock = NULL;
84 Monitor* MethodCompileQueue_lock = NULL;
85 Monitor* CompileThread_lock = NULL;
86 Monitor* Compilation_lock = NULL;
87 Mutex* CompileTaskAlloc_lock = NULL;
88 Mutex* CompileStatistics_lock = NULL;
89 Mutex* DirectivesStack_lock = NULL;
90 Mutex* MultiArray_lock = NULL;
91 Monitor* Terminator_lock = NULL;
92 Monitor* InitCompleted_lock = NULL;
93 Monitor* BeforeExit_lock = NULL;
94 Monitor* Notify_lock = NULL;
95 Mutex* ProfilePrint_lock = NULL;
96 Mutex* ExceptionCache_lock = NULL;
194 }
195 #endif
196
197 #define def(var, type, pri, vm_block, safepoint_check_allowed ) { \
198 var = new type(Mutex::pri, #var, vm_block, Mutex::safepoint_check_allowed); \
199 assert(_num_mutex < MAX_NUM_MUTEX, "increase MAX_NUM_MUTEX"); \
200 _mutex_array[_num_mutex++] = var; \
201 }
202
203 // Using Padded subclasses to prevent false sharing of these global monitors and mutexes.
204 void mutex_init() {
205 def(tty_lock , PaddedMutex , tty, true, _safepoint_check_never); // allow to lock in VM
206
207 def(CGC_lock , PaddedMonitor, special, true, _safepoint_check_never); // coordinate between fore- and background GC
208 def(STS_lock , PaddedMonitor, leaf, true, _safepoint_check_never);
209
210 def(FullGCCount_lock , PaddedMonitor, leaf, true, _safepoint_check_never); // in support of ExplicitGCInvokesConcurrent
211 if (UseG1GC) {
212 def(G1OldGCCount_lock , PaddedMonitor, leaf, true, _safepoint_check_always);
213
214 def(DirtyCardQ_CBL_mon , PaddedMonitor, access, true, _safepoint_check_never);
215 def(Shared_DirtyCardQ_lock , PaddedMutex , access + 1, true, _safepoint_check_never);
216
217 def(FreeList_lock , PaddedMutex , leaf , true, _safepoint_check_never);
218 def(OldSets_lock , PaddedMutex , leaf , true, _safepoint_check_never);
219 def(RootRegionScan_lock , PaddedMonitor, leaf , true, _safepoint_check_never);
220
221 def(StringDedupQueue_lock , PaddedMonitor, leaf, true, _safepoint_check_never);
222 def(StringDedupTable_lock , PaddedMutex , leaf, true, _safepoint_check_never);
223
224 def(MarkStackFreeList_lock , PaddedMutex , leaf , true, _safepoint_check_never);
225 def(MarkStackChunkList_lock , PaddedMutex , leaf , true, _safepoint_check_never);
226
227 def(MonitoringSupport_lock , PaddedMutex , native , true, _safepoint_check_never); // used for serviceability monitoring support
228 }
229 if (UseShenandoahGC) {
230 def(StringDedupQueue_lock , PaddedMonitor, leaf, true, _safepoint_check_never);
231 def(StringDedupTable_lock , PaddedMutex , leaf, true, _safepoint_check_never);
232 }
233 def(ParGCRareEvent_lock , PaddedMutex , leaf , true, _safepoint_check_always);
234 def(CGCPhaseManager_lock , PaddedMonitor, leaf, false, _safepoint_check_always);
|
1 /*
2 * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
56 Mutex* ExpandHeap_lock = NULL;
57 Mutex* AdapterHandlerLibrary_lock = NULL;
58 Mutex* SignatureHandlerLibrary_lock = NULL;
59 Mutex* VtableStubs_lock = NULL;
60 Mutex* SymbolArena_lock = NULL;
61 Monitor* StringDedupQueue_lock = NULL;
62 Mutex* StringDedupTable_lock = NULL;
63 Monitor* CodeCache_lock = NULL;
64 Mutex* MethodData_lock = NULL;
65 Mutex* TouchedMethodLog_lock = NULL;
66 Mutex* RetData_lock = NULL;
67 Monitor* VMOperationQueue_lock = NULL;
68 Monitor* VMOperationRequest_lock = NULL;
69 Monitor* Threads_lock = NULL;
70 Mutex* NonJavaThreadsList_lock = NULL;
71 Mutex* NonJavaThreadsListSync_lock = NULL;
72 Monitor* CGC_lock = NULL;
73 Monitor* STS_lock = NULL;
74 Monitor* FullGCCount_lock = NULL;
75 Monitor* G1OldGCCount_lock = NULL;
76 Mutex* Shared_DirtyCardQ_lock = NULL;
77 Mutex* MarkStackFreeList_lock = NULL;
78 Mutex* MarkStackChunkList_lock = NULL;
79 Mutex* MonitoringSupport_lock = NULL;
80 Mutex* ParGCRareEvent_lock = NULL;
81 Monitor* CGCPhaseManager_lock = NULL;
82 Mutex* Compile_lock = NULL;
83 Monitor* MethodCompileQueue_lock = NULL;
84 Monitor* CompileThread_lock = NULL;
85 Monitor* Compilation_lock = NULL;
86 Mutex* CompileTaskAlloc_lock = NULL;
87 Mutex* CompileStatistics_lock = NULL;
88 Mutex* DirectivesStack_lock = NULL;
89 Mutex* MultiArray_lock = NULL;
90 Monitor* Terminator_lock = NULL;
91 Monitor* InitCompleted_lock = NULL;
92 Monitor* BeforeExit_lock = NULL;
93 Monitor* Notify_lock = NULL;
94 Mutex* ProfilePrint_lock = NULL;
95 Mutex* ExceptionCache_lock = NULL;
193 }
194 #endif
195
196 #define def(var, type, pri, vm_block, safepoint_check_allowed ) { \
197 var = new type(Mutex::pri, #var, vm_block, Mutex::safepoint_check_allowed); \
198 assert(_num_mutex < MAX_NUM_MUTEX, "increase MAX_NUM_MUTEX"); \
199 _mutex_array[_num_mutex++] = var; \
200 }
201
202 // Using Padded subclasses to prevent false sharing of these global monitors and mutexes.
203 void mutex_init() {
204 def(tty_lock , PaddedMutex , tty, true, _safepoint_check_never); // allow to lock in VM
205
206 def(CGC_lock , PaddedMonitor, special, true, _safepoint_check_never); // coordinate between fore- and background GC
207 def(STS_lock , PaddedMonitor, leaf, true, _safepoint_check_never);
208
209 def(FullGCCount_lock , PaddedMonitor, leaf, true, _safepoint_check_never); // in support of ExplicitGCInvokesConcurrent
210 if (UseG1GC) {
211 def(G1OldGCCount_lock , PaddedMonitor, leaf, true, _safepoint_check_always);
212
213 def(Shared_DirtyCardQ_lock , PaddedMutex , access + 1, true, _safepoint_check_never);
214
215 def(FreeList_lock , PaddedMutex , leaf , true, _safepoint_check_never);
216 def(OldSets_lock , PaddedMutex , leaf , true, _safepoint_check_never);
217 def(RootRegionScan_lock , PaddedMonitor, leaf , true, _safepoint_check_never);
218
219 def(StringDedupQueue_lock , PaddedMonitor, leaf, true, _safepoint_check_never);
220 def(StringDedupTable_lock , PaddedMutex , leaf, true, _safepoint_check_never);
221
222 def(MarkStackFreeList_lock , PaddedMutex , leaf , true, _safepoint_check_never);
223 def(MarkStackChunkList_lock , PaddedMutex , leaf , true, _safepoint_check_never);
224
225 def(MonitoringSupport_lock , PaddedMutex , native , true, _safepoint_check_never); // used for serviceability monitoring support
226 }
227 if (UseShenandoahGC) {
228 def(StringDedupQueue_lock , PaddedMonitor, leaf, true, _safepoint_check_never);
229 def(StringDedupTable_lock , PaddedMutex , leaf, true, _safepoint_check_never);
230 }
231 def(ParGCRareEvent_lock , PaddedMutex , leaf , true, _safepoint_check_always);
232 def(CGCPhaseManager_lock , PaddedMonitor, leaf, false, _safepoint_check_always);
|