author | kvn |
Tue, 01 Aug 2017 14:09:34 -0700 | |
changeset 46735 | 219c4312853e |
parent 46495 | 34f7d403039f |
permissions | -rw-r--r-- |
1 | 1 |
/* |
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
37466
diff
changeset
|
2 |
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. |
1 | 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 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4750
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4750
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4750
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
7397 | 25 |
#ifndef SHARE_VM_RUNTIME_VM_OPERATIONS_HPP |
26 |
#define SHARE_VM_RUNTIME_VM_OPERATIONS_HPP |
|
27 |
||
28 |
#include "classfile/javaClasses.hpp" |
|
29 |
#include "memory/allocation.hpp" |
|
30 |
#include "oops/oop.hpp" |
|
31 |
#include "runtime/thread.hpp" |
|
35086
bbf32241d851
8072008: Emit direct call instead of linkTo* for recursive indy/MH.invoke* calls
vlivanov
parents:
33160
diff
changeset
|
32 |
#include "code/codeCache.hpp" |
7397 | 33 |
|
1 | 34 |
// The following classes are used for operations |
35 |
// initiated by a Java thread but that must |
|
36 |
// take place in the VMThread. |
|
37 |
||
38 |
#define VM_OP_ENUM(type) VMOp_##type, |
|
39 |
||
40 |
// Note: When new VM_XXX comes up, add 'XXX' to the template table. |
|
41 |
#define VM_OPS_DO(template) \ |
|
42 |
template(Dummy) \ |
|
43 |
template(ThreadStop) \ |
|
44 |
template(ThreadDump) \ |
|
45 |
template(PrintThreads) \ |
|
46 |
template(FindDeadlocks) \ |
|
35086
bbf32241d851
8072008: Emit direct call instead of linkTo* for recursive indy/MH.invoke* calls
vlivanov
parents:
33160
diff
changeset
|
47 |
template(ClearICs) \ |
1 | 48 |
template(ForceSafepoint) \ |
49 |
template(ForceAsyncSafepoint) \ |
|
50 |
template(Deoptimize) \ |
|
51 |
template(DeoptimizeFrame) \ |
|
52 |
template(DeoptimizeAll) \ |
|
53 |
template(ZombieAll) \ |
|
8076
96d498ec7ae1
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
7397
diff
changeset
|
54 |
template(UnlinkSymbols) \ |
1 | 55 |
template(Verify) \ |
56 |
template(PrintJNI) \ |
|
57 |
template(HeapDumper) \ |
|
58 |
template(DeoptimizeTheWorld) \ |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13195
diff
changeset
|
59 |
template(CollectForMetadataAllocation) \ |
1 | 60 |
template(GC_HeapInspection) \ |
61 |
template(GenCollectFull) \ |
|
62 |
template(GenCollectFullConcurrent) \ |
|
63 |
template(GenCollectForAllocation) \ |
|
64 |
template(ParallelGCFailedAllocation) \ |
|
65 |
template(ParallelGCSystemGC) \ |
|
1374
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
386
diff
changeset
|
66 |
template(CGC_Operation) \ |
1 | 67 |
template(CMS_Initial_Mark) \ |
68 |
template(CMS_Final_Remark) \ |
|
1374
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
386
diff
changeset
|
69 |
template(G1CollectFull) \ |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
386
diff
changeset
|
70 |
template(G1CollectForAllocation) \ |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
386
diff
changeset
|
71 |
template(G1IncCollectionPause) \ |
26837
72a43d3841e7
8057536: Refactor G1 to allow context specific allocations
sjohanss
parents:
26587
diff
changeset
|
72 |
template(DestroyAllocationContext) \ |
1 | 73 |
template(EnableBiasedLocking) \ |
74 |
template(RevokeBias) \ |
|
75 |
template(BulkRevokeBias) \ |
|
76 |
template(PopulateDumpSharedSpace) \ |
|
77 |
template(JNIFunctionTableCopier) \ |
|
78 |
template(RedefineClasses) \ |
|
23180
e87156376bed
6471769: Error: assert(_cur_stack_depth == count_frames(),"cur_stack_depth out of sync")
sspitsyn
parents:
22551
diff
changeset
|
79 |
template(UpdateForPopTopFrame) \ |
e87156376bed
6471769: Error: assert(_cur_stack_depth == count_frames(),"cur_stack_depth out of sync")
sspitsyn
parents:
22551
diff
changeset
|
80 |
template(SetFramePop) \ |
1 | 81 |
template(GetOwnedMonitorInfo) \ |
82 |
template(GetObjectMonitorUsage) \ |
|
83 |
template(GetCurrentContendedMonitor) \ |
|
84 |
template(GetStackTrace) \ |
|
85 |
template(GetMultipleStackTraces) \ |
|
86 |
template(GetAllStackTraces) \ |
|
87 |
template(GetThreadListStackTraces) \ |
|
88 |
template(GetFrameCount) \ |
|
89 |
template(GetFrameLocation) \ |
|
90 |
template(ChangeBreakpoints) \ |
|
91 |
template(GetOrSetLocal) \ |
|
92 |
template(GetCurrentLocation) \ |
|
93 |
template(EnterInterpOnlyMode) \ |
|
94 |
template(ChangeSingleStep) \ |
|
95 |
template(HeapWalkOperation) \ |
|
96 |
template(HeapIterateOperation) \ |
|
97 |
template(ReportJavaOutOfMemory) \ |
|
11480
1bf714e8adb4
7115199: Add event tracing hooks and Java Flight Recorder infrastructure
phh
parents:
8921
diff
changeset
|
98 |
template(JFRCheckpoint) \ |
1 | 99 |
template(Exit) \ |
15926
8e87d545195f
7107135: Stack guard pages are no more protected after loading a shared library with executable stack
iklam
parents:
13728
diff
changeset
|
100 |
template(LinuxDllLoad) \ |
23517 | 101 |
template(RotateGCLog) \ |
23848 | 102 |
template(WhiteBoxOperation) \ |
25051
8110ec6e7340
8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
23848
diff
changeset
|
103 |
template(ClassLoaderStatsOperation) \ |
28363
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
27696
diff
changeset
|
104 |
template(DumpHashtable) \ |
31790 | 105 |
template(DumpTouchedMethods) \ |
27420
04e6f914cce1
8046809: vm/mlvm/meth/stress/compiler/deoptimize CodeCache is full.
anoll
parents:
26837
diff
changeset
|
106 |
template(MarkActiveNMethods) \ |
36322 | 107 |
template(PrintCompileQueue) \ |
29071
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28363
diff
changeset
|
108 |
template(PrintClassHierarchy) \ |
46495
34f7d403039f
8152953: ForceSafepoint operations should be more specific
rehn
parents:
46329
diff
changeset
|
109 |
template(ThreadSuspend) \ |
34f7d403039f
8152953: ForceSafepoint operations should be more specific
rehn
parents:
46329
diff
changeset
|
110 |
template(CTWThreshold) \ |
34f7d403039f
8152953: ForceSafepoint operations should be more specific
rehn
parents:
46329
diff
changeset
|
111 |
template(ThreadsSuspendJVMTI) \ |
34f7d403039f
8152953: ForceSafepoint operations should be more specific
rehn
parents:
46329
diff
changeset
|
112 |
template(ICBufferFull) \ |
34f7d403039f
8152953: ForceSafepoint operations should be more specific
rehn
parents:
46329
diff
changeset
|
113 |
template(ScavengeMonitors) \ |
1 | 114 |
|
13195 | 115 |
class VM_Operation: public CHeapObj<mtInternal> { |
1 | 116 |
public: |
117 |
enum Mode { |
|
118 |
_safepoint, // blocking, safepoint, vm_op C-heap allocated |
|
119 |
_no_safepoint, // blocking, no safepoint, vm_op C-Heap allocated |
|
120 |
_concurrent, // non-blocking, no safepoint, vm_op C-Heap allocated |
|
121 |
_async_safepoint // non-blocking, safepoint, vm_op C-Heap allocated |
|
122 |
}; |
|
123 |
||
124 |
enum VMOp_Type { |
|
125 |
VM_OPS_DO(VM_OP_ENUM) |
|
126 |
VMOp_Terminating |
|
127 |
}; |
|
128 |
||
129 |
private: |
|
130 |
Thread* _calling_thread; |
|
131 |
ThreadPriority _priority; |
|
132 |
long _timestamp; |
|
133 |
VM_Operation* _next; |
|
134 |
VM_Operation* _prev; |
|
135 |
||
136 |
// The VM operation name array |
|
137 |
static const char* _names[]; |
|
138 |
||
139 |
public: |
|
140 |
VM_Operation() { _calling_thread = NULL; _next = NULL; _prev = NULL; } |
|
141 |
virtual ~VM_Operation() {} |
|
142 |
||
143 |
// VM operation support (used by VM thread) |
|
144 |
Thread* calling_thread() const { return _calling_thread; } |
|
145 |
ThreadPriority priority() { return _priority; } |
|
146 |
void set_calling_thread(Thread* thread, ThreadPriority priority); |
|
147 |
||
148 |
long timestamp() const { return _timestamp; } |
|
149 |
void set_timestamp(long timestamp) { _timestamp = timestamp; } |
|
150 |
||
151 |
// Called by VM thread - does in turn invoke doit(). Do not override this |
|
152 |
void evaluate(); |
|
153 |
||
154 |
// evaluate() is called by the VMThread and in turn calls doit(). |
|
155 |
// If the thread invoking VMThread::execute((VM_Operation*) is a JavaThread, |
|
156 |
// doit_prologue() is called in that thread before transferring control to |
|
157 |
// the VMThread. |
|
158 |
// If doit_prologue() returns true the VM operation will proceed, and |
|
159 |
// doit_epilogue() will be called by the JavaThread once the VM operation |
|
160 |
// completes. If doit_prologue() returns false the VM operation is cancelled. |
|
161 |
virtual void doit() = 0; |
|
162 |
virtual bool doit_prologue() { return true; }; |
|
163 |
virtual void doit_epilogue() {}; // Note: Not called if mode is: _concurrent |
|
164 |
||
165 |
// Type test |
|
166 |
virtual bool is_methodCompiler() const { return false; } |
|
167 |
||
168 |
// Linking |
|
169 |
VM_Operation *next() const { return _next; } |
|
170 |
VM_Operation *prev() const { return _prev; } |
|
171 |
void set_next(VM_Operation *next) { _next = next; } |
|
172 |
void set_prev(VM_Operation *prev) { _prev = prev; } |
|
173 |
||
22551 | 174 |
// Configuration. Override these appropriately in subclasses. |
1 | 175 |
virtual VMOp_Type type() const = 0; |
176 |
virtual Mode evaluation_mode() const { return _safepoint; } |
|
177 |
virtual bool allow_nested_vm_operations() const { return false; } |
|
178 |
virtual bool is_cheap_allocated() const { return false; } |
|
179 |
virtual void oops_do(OopClosure* f) { /* do nothing */ }; |
|
180 |
||
181 |
// CAUTION: <don't hang yourself with following rope> |
|
182 |
// If you override these methods, make sure that the evaluation |
|
183 |
// of these methods is race-free and non-blocking, since these |
|
184 |
// methods may be evaluated either by the mutators or by the |
|
185 |
// vm thread, either concurrently with mutators or with the mutators |
|
186 |
// stopped. In other words, taking locks is verboten, and if there |
|
187 |
// are any races in evaluating the conditions, they'd better be benign. |
|
188 |
virtual bool evaluate_at_safepoint() const { |
|
189 |
return evaluation_mode() == _safepoint || |
|
190 |
evaluation_mode() == _async_safepoint; |
|
191 |
} |
|
192 |
virtual bool evaluate_concurrently() const { |
|
193 |
return evaluation_mode() == _concurrent || |
|
194 |
evaluation_mode() == _async_safepoint; |
|
195 |
} |
|
196 |
||
18025 | 197 |
static const char* mode_to_string(Mode mode); |
198 |
||
1 | 199 |
// Debugging |
31234
48000028382c
8081219: hs_err improvement: Add event logging for class redefinition to the hs_err file
coleenp
parents:
29071
diff
changeset
|
200 |
virtual void print_on_error(outputStream* st) const; |
1 | 201 |
const char* name() const { return _names[type()]; } |
202 |
static const char* name(int type) { |
|
203 |
assert(type >= 0 && type < VMOp_Terminating, "invalid VM operation type"); |
|
204 |
return _names[type]; |
|
205 |
} |
|
206 |
#ifndef PRODUCT |
|
207 |
void print_on(outputStream* st) const { print_on_error(st); } |
|
208 |
#endif |
|
209 |
}; |
|
210 |
||
211 |
class VM_ThreadStop: public VM_Operation { |
|
212 |
private: |
|
213 |
oop _thread; // The Thread that the Throwable is thrown against |
|
214 |
oop _throwable; // The Throwable thrown at the target Thread |
|
215 |
public: |
|
216 |
// All oops are passed as JNI handles, since there is no guarantee that a GC might happen before the |
|
217 |
// VM operation is executed. |
|
218 |
VM_ThreadStop(oop thread, oop throwable) { |
|
219 |
_thread = thread; |
|
220 |
_throwable = throwable; |
|
221 |
} |
|
222 |
VMOp_Type type() const { return VMOp_ThreadStop; } |
|
223 |
oop target_thread() const { return _thread; } |
|
224 |
oop throwable() const { return _throwable;} |
|
225 |
void doit(); |
|
226 |
// We deoptimize if top-most frame is compiled - this might require a C2I adapter to be generated |
|
227 |
bool allow_nested_vm_operations() const { return true; } |
|
228 |
Mode evaluation_mode() const { return _async_safepoint; } |
|
229 |
bool is_cheap_allocated() const { return true; } |
|
230 |
||
231 |
// GC support |
|
232 |
void oops_do(OopClosure* f) { |
|
233 |
f->do_oop(&_thread); f->do_oop(&_throwable); |
|
234 |
} |
|
235 |
}; |
|
236 |
||
35086
bbf32241d851
8072008: Emit direct call instead of linkTo* for recursive indy/MH.invoke* calls
vlivanov
parents:
33160
diff
changeset
|
237 |
class VM_ClearICs: public VM_Operation { |
37289
9989add27bf4
8067247: Crash: assert(method_holder->data() == 0 ...) failed: a) MT-unsafe modification of inline cache
jcm
parents:
36322
diff
changeset
|
238 |
private: |
9989add27bf4
8067247: Crash: assert(method_holder->data() == 0 ...) failed: a) MT-unsafe modification of inline cache
jcm
parents:
36322
diff
changeset
|
239 |
bool _preserve_static_stubs; |
35086
bbf32241d851
8072008: Emit direct call instead of linkTo* for recursive indy/MH.invoke* calls
vlivanov
parents:
33160
diff
changeset
|
240 |
public: |
37289
9989add27bf4
8067247: Crash: assert(method_holder->data() == 0 ...) failed: a) MT-unsafe modification of inline cache
jcm
parents:
36322
diff
changeset
|
241 |
VM_ClearICs(bool preserve_static_stubs) { _preserve_static_stubs = preserve_static_stubs; } |
9989add27bf4
8067247: Crash: assert(method_holder->data() == 0 ...) failed: a) MT-unsafe modification of inline cache
jcm
parents:
36322
diff
changeset
|
242 |
void doit(); |
35086
bbf32241d851
8072008: Emit direct call instead of linkTo* for recursive indy/MH.invoke* calls
vlivanov
parents:
33160
diff
changeset
|
243 |
VMOp_Type type() const { return VMOp_ClearICs; } |
bbf32241d851
8072008: Emit direct call instead of linkTo* for recursive indy/MH.invoke* calls
vlivanov
parents:
33160
diff
changeset
|
244 |
}; |
bbf32241d851
8072008: Emit direct call instead of linkTo* for recursive indy/MH.invoke* calls
vlivanov
parents:
33160
diff
changeset
|
245 |
|
46495
34f7d403039f
8152953: ForceSafepoint operations should be more specific
rehn
parents:
46329
diff
changeset
|
246 |
// empty vm op, evaluated just to force a safepoint |
1 | 247 |
class VM_ForceSafepoint: public VM_Operation { |
248 |
public: |
|
249 |
void doit() {} |
|
250 |
VMOp_Type type() const { return VMOp_ForceSafepoint; } |
|
251 |
}; |
|
252 |
||
46495
34f7d403039f
8152953: ForceSafepoint operations should be more specific
rehn
parents:
46329
diff
changeset
|
253 |
// empty vm op, when forcing a safepoint to suspend a thread |
34f7d403039f
8152953: ForceSafepoint operations should be more specific
rehn
parents:
46329
diff
changeset
|
254 |
class VM_ThreadSuspend: public VM_ForceSafepoint { |
34f7d403039f
8152953: ForceSafepoint operations should be more specific
rehn
parents:
46329
diff
changeset
|
255 |
public: |
34f7d403039f
8152953: ForceSafepoint operations should be more specific
rehn
parents:
46329
diff
changeset
|
256 |
VMOp_Type type() const { return VMOp_ThreadSuspend; } |
34f7d403039f
8152953: ForceSafepoint operations should be more specific
rehn
parents:
46329
diff
changeset
|
257 |
}; |
34f7d403039f
8152953: ForceSafepoint operations should be more specific
rehn
parents:
46329
diff
changeset
|
258 |
|
34f7d403039f
8152953: ForceSafepoint operations should be more specific
rehn
parents:
46329
diff
changeset
|
259 |
// empty vm op, when forcing a safepoint due to ctw threshold is reached for the sweeper |
34f7d403039f
8152953: ForceSafepoint operations should be more specific
rehn
parents:
46329
diff
changeset
|
260 |
class VM_CTWThreshold: public VM_ForceSafepoint { |
1 | 261 |
public: |
46495
34f7d403039f
8152953: ForceSafepoint operations should be more specific
rehn
parents:
46329
diff
changeset
|
262 |
VMOp_Type type() const { return VMOp_CTWThreshold; } |
34f7d403039f
8152953: ForceSafepoint operations should be more specific
rehn
parents:
46329
diff
changeset
|
263 |
}; |
34f7d403039f
8152953: ForceSafepoint operations should be more specific
rehn
parents:
46329
diff
changeset
|
264 |
|
34f7d403039f
8152953: ForceSafepoint operations should be more specific
rehn
parents:
46329
diff
changeset
|
265 |
// empty vm op, when forcing a safepoint to suspend threads from jvmti |
34f7d403039f
8152953: ForceSafepoint operations should be more specific
rehn
parents:
46329
diff
changeset
|
266 |
class VM_ThreadsSuspendJVMTI: public VM_ForceSafepoint { |
34f7d403039f
8152953: ForceSafepoint operations should be more specific
rehn
parents:
46329
diff
changeset
|
267 |
public: |
34f7d403039f
8152953: ForceSafepoint operations should be more specific
rehn
parents:
46329
diff
changeset
|
268 |
VMOp_Type type() const { return VMOp_ThreadsSuspendJVMTI; } |
34f7d403039f
8152953: ForceSafepoint operations should be more specific
rehn
parents:
46329
diff
changeset
|
269 |
}; |
34f7d403039f
8152953: ForceSafepoint operations should be more specific
rehn
parents:
46329
diff
changeset
|
270 |
|
34f7d403039f
8152953: ForceSafepoint operations should be more specific
rehn
parents:
46329
diff
changeset
|
271 |
// empty vm op, when forcing a safepoint due to inline cache buffers being full |
34f7d403039f
8152953: ForceSafepoint operations should be more specific
rehn
parents:
46329
diff
changeset
|
272 |
class VM_ICBufferFull: public VM_ForceSafepoint { |
34f7d403039f
8152953: ForceSafepoint operations should be more specific
rehn
parents:
46329
diff
changeset
|
273 |
public: |
34f7d403039f
8152953: ForceSafepoint operations should be more specific
rehn
parents:
46329
diff
changeset
|
274 |
VMOp_Type type() const { return VMOp_ICBufferFull; } |
34f7d403039f
8152953: ForceSafepoint operations should be more specific
rehn
parents:
46329
diff
changeset
|
275 |
}; |
34f7d403039f
8152953: ForceSafepoint operations should be more specific
rehn
parents:
46329
diff
changeset
|
276 |
|
34f7d403039f
8152953: ForceSafepoint operations should be more specific
rehn
parents:
46329
diff
changeset
|
277 |
// empty asynchronous vm op, when forcing a safepoint to scavenge monitors |
34f7d403039f
8152953: ForceSafepoint operations should be more specific
rehn
parents:
46329
diff
changeset
|
278 |
class VM_ScavengeMonitors: public VM_ForceSafepoint { |
34f7d403039f
8152953: ForceSafepoint operations should be more specific
rehn
parents:
46329
diff
changeset
|
279 |
public: |
34f7d403039f
8152953: ForceSafepoint operations should be more specific
rehn
parents:
46329
diff
changeset
|
280 |
VMOp_Type type() const { return VMOp_ScavengeMonitors; } |
1 | 281 |
Mode evaluation_mode() const { return _async_safepoint; } |
282 |
bool is_cheap_allocated() const { return true; } |
|
283 |
}; |
|
284 |
||
285 |
class VM_Deoptimize: public VM_Operation { |
|
286 |
public: |
|
287 |
VM_Deoptimize() {} |
|
288 |
VMOp_Type type() const { return VMOp_Deoptimize; } |
|
289 |
void doit(); |
|
290 |
bool allow_nested_vm_operations() const { return true; } |
|
291 |
}; |
|
292 |
||
27420
04e6f914cce1
8046809: vm/mlvm/meth/stress/compiler/deoptimize CodeCache is full.
anoll
parents:
26837
diff
changeset
|
293 |
class VM_MarkActiveNMethods: public VM_Operation { |
04e6f914cce1
8046809: vm/mlvm/meth/stress/compiler/deoptimize CodeCache is full.
anoll
parents:
26837
diff
changeset
|
294 |
public: |
04e6f914cce1
8046809: vm/mlvm/meth/stress/compiler/deoptimize CodeCache is full.
anoll
parents:
26837
diff
changeset
|
295 |
VM_MarkActiveNMethods() {} |
04e6f914cce1
8046809: vm/mlvm/meth/stress/compiler/deoptimize CodeCache is full.
anoll
parents:
26837
diff
changeset
|
296 |
VMOp_Type type() const { return VMOp_MarkActiveNMethods; } |
04e6f914cce1
8046809: vm/mlvm/meth/stress/compiler/deoptimize CodeCache is full.
anoll
parents:
26837
diff
changeset
|
297 |
void doit(); |
04e6f914cce1
8046809: vm/mlvm/meth/stress/compiler/deoptimize CodeCache is full.
anoll
parents:
26837
diff
changeset
|
298 |
bool allow_nested_vm_operations() const { return true; } |
04e6f914cce1
8046809: vm/mlvm/meth/stress/compiler/deoptimize CodeCache is full.
anoll
parents:
26837
diff
changeset
|
299 |
}; |
7106
867c9d296c6b
6968367: can_post_on_exceptions is still using VM_DeoptimizeFrame in some places
never
parents:
5547
diff
changeset
|
300 |
|
867c9d296c6b
6968367: can_post_on_exceptions is still using VM_DeoptimizeFrame in some places
never
parents:
5547
diff
changeset
|
301 |
// Deopt helper that can deoptimize frames in threads other than the |
867c9d296c6b
6968367: can_post_on_exceptions is still using VM_DeoptimizeFrame in some places
never
parents:
5547
diff
changeset
|
302 |
// current thread. Only used through Deoptimization::deoptimize_frame. |
1 | 303 |
class VM_DeoptimizeFrame: public VM_Operation { |
7106
867c9d296c6b
6968367: can_post_on_exceptions is still using VM_DeoptimizeFrame in some places
never
parents:
5547
diff
changeset
|
304 |
friend class Deoptimization; |
867c9d296c6b
6968367: can_post_on_exceptions is still using VM_DeoptimizeFrame in some places
never
parents:
5547
diff
changeset
|
305 |
|
1 | 306 |
private: |
307 |
JavaThread* _thread; |
|
308 |
intptr_t* _id; |
|
33160
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
31790
diff
changeset
|
309 |
int _reason; |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
31790
diff
changeset
|
310 |
VM_DeoptimizeFrame(JavaThread* thread, intptr_t* id, int reason); |
7106
867c9d296c6b
6968367: can_post_on_exceptions is still using VM_DeoptimizeFrame in some places
never
parents:
5547
diff
changeset
|
311 |
|
1 | 312 |
public: |
313 |
VMOp_Type type() const { return VMOp_DeoptimizeFrame; } |
|
314 |
void doit(); |
|
315 |
bool allow_nested_vm_operations() const { return true; } |
|
316 |
}; |
|
317 |
||
318 |
#ifndef PRODUCT |
|
319 |
class VM_DeoptimizeAll: public VM_Operation { |
|
320 |
private: |
|
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
37466
diff
changeset
|
321 |
Klass* _dependee; |
1 | 322 |
public: |
323 |
VM_DeoptimizeAll() {} |
|
324 |
VMOp_Type type() const { return VMOp_DeoptimizeAll; } |
|
325 |
void doit(); |
|
326 |
bool allow_nested_vm_operations() const { return true; } |
|
327 |
}; |
|
328 |
||
329 |
||
330 |
class VM_ZombieAll: public VM_Operation { |
|
331 |
public: |
|
332 |
VM_ZombieAll() {} |
|
333 |
VMOp_Type type() const { return VMOp_ZombieAll; } |
|
334 |
void doit(); |
|
335 |
bool allow_nested_vm_operations() const { return true; } |
|
336 |
}; |
|
337 |
#endif // PRODUCT |
|
338 |
||
8076
96d498ec7ae1
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
7397
diff
changeset
|
339 |
class VM_UnlinkSymbols: public VM_Operation { |
96d498ec7ae1
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
7397
diff
changeset
|
340 |
public: |
96d498ec7ae1
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
7397
diff
changeset
|
341 |
VM_UnlinkSymbols() {} |
96d498ec7ae1
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
7397
diff
changeset
|
342 |
VMOp_Type type() const { return VMOp_UnlinkSymbols; } |
96d498ec7ae1
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
7397
diff
changeset
|
343 |
void doit(); |
96d498ec7ae1
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
7397
diff
changeset
|
344 |
bool allow_nested_vm_operations() const { return true; } |
96d498ec7ae1
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
7397
diff
changeset
|
345 |
}; |
96d498ec7ae1
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
7397
diff
changeset
|
346 |
|
1 | 347 |
class VM_Verify: public VM_Operation { |
348 |
public: |
|
349 |
VMOp_Type type() const { return VMOp_Verify; } |
|
350 |
void doit(); |
|
351 |
}; |
|
352 |
||
353 |
||
354 |
class VM_PrintThreads: public VM_Operation { |
|
355 |
private: |
|
356 |
outputStream* _out; |
|
357 |
bool _print_concurrent_locks; |
|
358 |
public: |
|
359 |
VM_PrintThreads() { _out = tty; _print_concurrent_locks = PrintConcurrentLocks; } |
|
360 |
VM_PrintThreads(outputStream* out, bool print_concurrent_locks) { _out = out; _print_concurrent_locks = print_concurrent_locks; } |
|
361 |
VMOp_Type type() const { return VMOp_PrintThreads; } |
|
362 |
void doit(); |
|
363 |
bool doit_prologue(); |
|
364 |
void doit_epilogue(); |
|
365 |
}; |
|
366 |
||
367 |
class VM_PrintJNI: public VM_Operation { |
|
368 |
private: |
|
369 |
outputStream* _out; |
|
370 |
public: |
|
371 |
VM_PrintJNI() { _out = tty; } |
|
372 |
VM_PrintJNI(outputStream* out) { _out = out; } |
|
373 |
VMOp_Type type() const { return VMOp_PrintJNI; } |
|
374 |
void doit(); |
|
375 |
}; |
|
376 |
||
377 |
class DeadlockCycle; |
|
378 |
class VM_FindDeadlocks: public VM_Operation { |
|
379 |
private: |
|
380 |
bool _concurrent_locks; |
|
381 |
DeadlockCycle* _deadlocks; |
|
382 |
outputStream* _out; |
|
383 |
||
384 |
public: |
|
385 |
VM_FindDeadlocks(bool concurrent_locks) : _concurrent_locks(concurrent_locks), _out(NULL), _deadlocks(NULL) {}; |
|
386 |
VM_FindDeadlocks(outputStream* st) : _concurrent_locks(true), _out(st), _deadlocks(NULL) {}; |
|
387 |
~VM_FindDeadlocks(); |
|
388 |
||
389 |
DeadlockCycle* result() { return _deadlocks; }; |
|
390 |
VMOp_Type type() const { return VMOp_FindDeadlocks; } |
|
391 |
void doit(); |
|
392 |
bool doit_prologue(); |
|
393 |
}; |
|
394 |
||
395 |
class ThreadDumpResult; |
|
396 |
class ThreadSnapshot; |
|
397 |
class ThreadConcurrentLocks; |
|
398 |
||
399 |
class VM_ThreadDump : public VM_Operation { |
|
400 |
private: |
|
401 |
ThreadDumpResult* _result; |
|
402 |
int _num_threads; |
|
403 |
GrowableArray<instanceHandle>* _threads; |
|
404 |
int _max_depth; |
|
405 |
bool _with_locked_monitors; |
|
406 |
bool _with_locked_synchronizers; |
|
407 |
||
408 |
ThreadSnapshot* snapshot_thread(JavaThread* java_thread, ThreadConcurrentLocks* tcl); |
|
409 |
||
410 |
public: |
|
411 |
VM_ThreadDump(ThreadDumpResult* result, |
|
412 |
int max_depth, // -1 indicates entire stack |
|
413 |
bool with_locked_monitors, |
|
414 |
bool with_locked_synchronizers); |
|
415 |
||
416 |
VM_ThreadDump(ThreadDumpResult* result, |
|
417 |
GrowableArray<instanceHandle>* threads, |
|
418 |
int num_threads, // -1 indicates entire stack |
|
419 |
int max_depth, |
|
420 |
bool with_locked_monitors, |
|
421 |
bool with_locked_synchronizers); |
|
422 |
||
423 |
VMOp_Type type() const { return VMOp_ThreadDump; } |
|
424 |
void doit(); |
|
425 |
bool doit_prologue(); |
|
426 |
void doit_epilogue(); |
|
427 |
}; |
|
428 |
||
429 |
||
430 |
class VM_Exit: public VM_Operation { |
|
431 |
private: |
|
432 |
int _exit_code; |
|
433 |
static volatile bool _vm_exited; |
|
434 |
static Thread * _shutdown_thread; |
|
435 |
static void wait_if_vm_exited(); |
|
436 |
public: |
|
437 |
VM_Exit(int exit_code) { |
|
438 |
_exit_code = exit_code; |
|
439 |
} |
|
440 |
static int wait_for_threads_in_native_to_block(); |
|
441 |
static int set_vm_exited(); |
|
442 |
static bool vm_exited() { return _vm_exited; } |
|
443 |
static void block_if_vm_exited() { |
|
444 |
if (_vm_exited) { |
|
445 |
wait_if_vm_exited(); |
|
446 |
} |
|
447 |
} |
|
448 |
VMOp_Type type() const { return VMOp_Exit; } |
|
449 |
void doit(); |
|
450 |
}; |
|
7397 | 451 |
|
36322 | 452 |
class VM_PrintCompileQueue: public VM_Operation { |
453 |
private: |
|
454 |
outputStream* _out; |
|
455 |
||
456 |
public: |
|
457 |
VM_PrintCompileQueue(outputStream* st) : _out(st) {} |
|
458 |
VMOp_Type type() const { return VMOp_PrintCompileQueue; } |
|
459 |
Mode evaluation_mode() const { return _safepoint; } |
|
460 |
void doit(); |
|
461 |
}; |
|
462 |
||
29071
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28363
diff
changeset
|
463 |
#if INCLUDE_SERVICES |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28363
diff
changeset
|
464 |
class VM_PrintClassHierarchy: public VM_Operation { |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28363
diff
changeset
|
465 |
private: |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28363
diff
changeset
|
466 |
outputStream* _out; |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28363
diff
changeset
|
467 |
bool _print_interfaces; |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28363
diff
changeset
|
468 |
bool _print_subclasses; |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28363
diff
changeset
|
469 |
char* _classname; |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28363
diff
changeset
|
470 |
|
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28363
diff
changeset
|
471 |
public: |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28363
diff
changeset
|
472 |
VM_PrintClassHierarchy(outputStream* st, bool print_interfaces, bool print_subclasses, char* classname) : |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28363
diff
changeset
|
473 |
_out(st), _print_interfaces(print_interfaces), _print_subclasses(print_subclasses), |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28363
diff
changeset
|
474 |
_classname(classname) {} |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28363
diff
changeset
|
475 |
VMOp_Type type() const { return VMOp_PrintClassHierarchy; } |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28363
diff
changeset
|
476 |
void doit(); |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28363
diff
changeset
|
477 |
}; |
73f45d04ad7a
8054888: Runtime: Add Diagnostic Command that prints the class hierarchy
cjplummer
parents:
28363
diff
changeset
|
478 |
#endif // INCLUDE_SERVICES |
26587 | 479 |
|
7397 | 480 |
#endif // SHARE_VM_RUNTIME_VM_OPERATIONS_HPP |