Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/lib/sun/hotspot/WhiteBox.java
41144 views
1
/*
2
* Copyright (c) 2012, 2021, 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
*/
23
24
package sun.hotspot;
25
26
import java.lang.management.MemoryUsage;
27
import java.lang.reflect.Executable;
28
import java.util.Arrays;
29
import java.util.List;
30
import java.util.function.BiFunction;
31
import java.util.function.Function;
32
import java.security.BasicPermission;
33
import java.util.Objects;
34
35
import sun.hotspot.parser.DiagnosticCommand;
36
37
public class WhiteBox {
38
@SuppressWarnings("serial")
39
public static class WhiteBoxPermission extends BasicPermission {
40
public WhiteBoxPermission(String s) {
41
super(s);
42
}
43
}
44
45
private WhiteBox() {}
46
private static final WhiteBox instance = new WhiteBox();
47
private static native void registerNatives();
48
49
/**
50
* Returns the singleton WhiteBox instance.
51
*
52
* The returned WhiteBox object should be carefully guarded
53
* by the caller, since it can be used to read and write data
54
* at arbitrary memory addresses. It must never be passed to
55
* untrusted code.
56
*/
57
public synchronized static WhiteBox getWhiteBox() {
58
@SuppressWarnings("removal")
59
SecurityManager sm = System.getSecurityManager();
60
if (sm != null) {
61
sm.checkPermission(new WhiteBoxPermission("getInstance"));
62
}
63
return instance;
64
}
65
66
static {
67
registerNatives();
68
}
69
70
// Get the maximum heap size supporting COOPs
71
public native long getCompressedOopsMaxHeapSize();
72
// Arguments
73
public native void printHeapSizes();
74
75
// Memory
76
private native long getObjectAddress0(Object o);
77
public long getObjectAddress(Object o) {
78
Objects.requireNonNull(o);
79
return getObjectAddress0(o);
80
}
81
82
public native int getHeapOopSize();
83
public native int getVMPageSize();
84
public native long getVMAllocationGranularity();
85
public native long getVMLargePageSize();
86
public native long getHeapSpaceAlignment();
87
public native long getHeapAlignment();
88
89
private native boolean isObjectInOldGen0(Object o);
90
public boolean isObjectInOldGen(Object o) {
91
Objects.requireNonNull(o);
92
return isObjectInOldGen0(o);
93
}
94
95
private native long getObjectSize0(Object o);
96
public long getObjectSize(Object o) {
97
Objects.requireNonNull(o);
98
return getObjectSize0(o);
99
}
100
101
// Runtime
102
// Make sure class name is in the correct format
103
public int countAliveClasses(String name) {
104
return countAliveClasses0(name.replace('.', '/'));
105
}
106
private native int countAliveClasses0(String name);
107
108
public boolean isClassAlive(String name) {
109
return countAliveClasses(name) != 0;
110
}
111
112
public native int getSymbolRefcount(String name);
113
114
public native boolean deflateIdleMonitors();
115
116
private native boolean isMonitorInflated0(Object obj);
117
public boolean isMonitorInflated(Object obj) {
118
Objects.requireNonNull(obj);
119
return isMonitorInflated0(obj);
120
}
121
122
public native void forceSafepoint();
123
124
private native long getConstantPool0(Class<?> aClass);
125
public long getConstantPool(Class<?> aClass) {
126
Objects.requireNonNull(aClass);
127
return getConstantPool0(aClass);
128
}
129
130
private native int getConstantPoolCacheIndexTag0();
131
public int getConstantPoolCacheIndexTag() {
132
return getConstantPoolCacheIndexTag0();
133
}
134
135
private native int getConstantPoolCacheLength0(Class<?> aClass);
136
public int getConstantPoolCacheLength(Class<?> aClass) {
137
Objects.requireNonNull(aClass);
138
return getConstantPoolCacheLength0(aClass);
139
}
140
141
private native int remapInstructionOperandFromCPCache0(Class<?> aClass, int index);
142
public int remapInstructionOperandFromCPCache(Class<?> aClass, int index) {
143
Objects.requireNonNull(aClass);
144
return remapInstructionOperandFromCPCache0(aClass, index);
145
}
146
147
private native int encodeConstantPoolIndyIndex0(int index);
148
public int encodeConstantPoolIndyIndex(int index) {
149
return encodeConstantPoolIndyIndex0(index);
150
}
151
152
// JVMTI
153
private native void addToBootstrapClassLoaderSearch0(String segment);
154
public void addToBootstrapClassLoaderSearch(String segment){
155
Objects.requireNonNull(segment);
156
addToBootstrapClassLoaderSearch0(segment);
157
}
158
159
private native void addToSystemClassLoaderSearch0(String segment);
160
public void addToSystemClassLoaderSearch(String segment) {
161
Objects.requireNonNull(segment);
162
addToSystemClassLoaderSearch0(segment);
163
}
164
165
// G1
166
public native boolean g1InConcurrentMark();
167
public native boolean g1HasRegionsToUncommit();
168
private native boolean g1IsHumongous0(Object o);
169
public boolean g1IsHumongous(Object o) {
170
Objects.requireNonNull(o);
171
return g1IsHumongous0(o);
172
}
173
174
private native boolean g1BelongsToHumongousRegion0(long adr);
175
public boolean g1BelongsToHumongousRegion(long adr) {
176
if (adr == 0) {
177
throw new IllegalArgumentException("adr argument should not be null");
178
}
179
return g1BelongsToHumongousRegion0(adr);
180
}
181
182
183
private native boolean g1BelongsToFreeRegion0(long adr);
184
public boolean g1BelongsToFreeRegion(long adr) {
185
if (adr == 0) {
186
throw new IllegalArgumentException("adr argument should not be null");
187
}
188
return g1BelongsToFreeRegion0(adr);
189
}
190
191
public native long g1NumMaxRegions();
192
public native long g1NumFreeRegions();
193
public native int g1RegionSize();
194
public native MemoryUsage g1AuxiliaryMemoryUsage();
195
private native Object[] parseCommandLine0(String commandline, char delim, DiagnosticCommand[] args);
196
public Object[] parseCommandLine(String commandline, char delim, DiagnosticCommand[] args) {
197
Objects.requireNonNull(args);
198
return parseCommandLine0(commandline, delim, args);
199
}
200
201
public native int g1ActiveMemoryNodeCount();
202
public native int[] g1MemoryNodeIds();
203
204
// Parallel GC
205
public native long psVirtualSpaceAlignment();
206
public native long psHeapGenerationAlignment();
207
208
/**
209
* Enumerates old regions with liveness less than specified and produces some statistics
210
* @param liveness percent of region's liveness (live_objects / total_region_size * 100).
211
* @return long[3] array where long[0] - total count of old regions
212
* long[1] - total memory of old regions
213
* long[2] - lowest estimation of total memory of old regions to be freed (non-full
214
* regions are not included)
215
*/
216
public native long[] g1GetMixedGCInfo(int liveness);
217
218
// NMT
219
public native long NMTMalloc(long size);
220
public native void NMTFree(long mem);
221
public native long NMTReserveMemory(long size);
222
public native long NMTAttemptReserveMemoryAt(long addr, long size);
223
public native void NMTCommitMemory(long addr, long size);
224
public native void NMTUncommitMemory(long addr, long size);
225
public native void NMTReleaseMemory(long addr, long size);
226
public native long NMTMallocWithPseudoStack(long size, int index);
227
public native long NMTMallocWithPseudoStackAndType(long size, int index, int type);
228
public native boolean NMTChangeTrackingLevel();
229
public native int NMTGetHashSize();
230
public native long NMTNewArena(long initSize);
231
public native void NMTFreeArena(long arena);
232
public native void NMTArenaMalloc(long arena, long size);
233
234
// Compiler
235
public native boolean isC2OrJVMCIIncluded();
236
public native boolean isJVMCISupportedByGC();
237
238
public native int matchesMethod(Executable method, String pattern);
239
public native int matchesInline(Executable method, String pattern);
240
public native boolean shouldPrintAssembly(Executable method, int comp_level);
241
public native int deoptimizeFrames(boolean makeNotEntrant);
242
public native boolean isFrameDeoptimized(int depth);
243
public native void deoptimizeAll();
244
245
public boolean isMethodCompiled(Executable method) {
246
return isMethodCompiled(method, false /*not osr*/);
247
}
248
private native boolean isMethodCompiled0(Executable method, boolean isOsr);
249
public boolean isMethodCompiled(Executable method, boolean isOsr){
250
Objects.requireNonNull(method);
251
return isMethodCompiled0(method, isOsr);
252
}
253
public boolean isMethodCompilable(Executable method) {
254
return isMethodCompilable(method, -1 /*any*/);
255
}
256
public boolean isMethodCompilable(Executable method, int compLevel) {
257
return isMethodCompilable(method, compLevel, false /*not osr*/);
258
}
259
private native boolean isMethodCompilable0(Executable method, int compLevel, boolean isOsr);
260
public boolean isMethodCompilable(Executable method, int compLevel, boolean isOsr) {
261
Objects.requireNonNull(method);
262
return isMethodCompilable0(method, compLevel, isOsr);
263
}
264
private native boolean isMethodQueuedForCompilation0(Executable method);
265
public boolean isMethodQueuedForCompilation(Executable method) {
266
Objects.requireNonNull(method);
267
return isMethodQueuedForCompilation0(method);
268
}
269
// Determine if the compiler corresponding to the compilation level 'compLevel'
270
// and to the compilation context 'compilation_context' provides an intrinsic
271
// for the method 'method'. An intrinsic is available for method 'method' if:
272
// - the intrinsic is enabled (by using the appropriate command-line flag) and
273
// - the platform on which the VM is running provides the instructions necessary
274
// for the compiler to generate the intrinsic code.
275
//
276
// The compilation context is related to using the DisableIntrinsic flag on a
277
// per-method level, see hotspot/src/share/vm/compiler/abstractCompiler.hpp
278
// for more details.
279
public boolean isIntrinsicAvailable(Executable method,
280
Executable compilationContext,
281
int compLevel) {
282
Objects.requireNonNull(method);
283
return isIntrinsicAvailable0(method, compilationContext, compLevel);
284
}
285
// If usage of the DisableIntrinsic flag is not expected (or the usage can be ignored),
286
// use the below method that does not require the compilation context as argument.
287
public boolean isIntrinsicAvailable(Executable method, int compLevel) {
288
return isIntrinsicAvailable(method, null, compLevel);
289
}
290
private native boolean isIntrinsicAvailable0(Executable method,
291
Executable compilationContext,
292
int compLevel);
293
public int deoptimizeMethod(Executable method) {
294
return deoptimizeMethod(method, false /*not osr*/);
295
}
296
private native int deoptimizeMethod0(Executable method, boolean isOsr);
297
public int deoptimizeMethod(Executable method, boolean isOsr) {
298
Objects.requireNonNull(method);
299
return deoptimizeMethod0(method, isOsr);
300
}
301
public void makeMethodNotCompilable(Executable method) {
302
makeMethodNotCompilable(method, -1 /*any*/);
303
}
304
public void makeMethodNotCompilable(Executable method, int compLevel) {
305
makeMethodNotCompilable(method, compLevel, false /*not osr*/);
306
}
307
private native void makeMethodNotCompilable0(Executable method, int compLevel, boolean isOsr);
308
public void makeMethodNotCompilable(Executable method, int compLevel, boolean isOsr) {
309
Objects.requireNonNull(method);
310
makeMethodNotCompilable0(method, compLevel, isOsr);
311
}
312
public int getMethodCompilationLevel(Executable method) {
313
return getMethodCompilationLevel(method, false /*not ost*/);
314
}
315
private native int getMethodCompilationLevel0(Executable method, boolean isOsr);
316
public int getMethodCompilationLevel(Executable method, boolean isOsr) {
317
Objects.requireNonNull(method);
318
return getMethodCompilationLevel0(method, isOsr);
319
}
320
private native boolean testSetDontInlineMethod0(Executable method, boolean value);
321
public boolean testSetDontInlineMethod(Executable method, boolean value) {
322
Objects.requireNonNull(method);
323
return testSetDontInlineMethod0(method, value);
324
}
325
public int getCompileQueuesSize() {
326
return getCompileQueueSize(-1 /*any*/);
327
}
328
public native int getCompileQueueSize(int compLevel);
329
private native boolean testSetForceInlineMethod0(Executable method, boolean value);
330
public boolean testSetForceInlineMethod(Executable method, boolean value) {
331
Objects.requireNonNull(method);
332
return testSetForceInlineMethod0(method, value);
333
}
334
public boolean enqueueMethodForCompilation(Executable method, int compLevel) {
335
return enqueueMethodForCompilation(method, compLevel, -1 /*InvocationEntryBci*/);
336
}
337
private native boolean enqueueMethodForCompilation0(Executable method, int compLevel, int entry_bci);
338
public boolean enqueueMethodForCompilation(Executable method, int compLevel, int entry_bci) {
339
Objects.requireNonNull(method);
340
return enqueueMethodForCompilation0(method, compLevel, entry_bci);
341
}
342
private native boolean enqueueInitializerForCompilation0(Class<?> aClass, int compLevel);
343
public boolean enqueueInitializerForCompilation(Class<?> aClass, int compLevel) {
344
Objects.requireNonNull(aClass);
345
return enqueueInitializerForCompilation0(aClass, compLevel);
346
}
347
private native void clearMethodState0(Executable method);
348
public native void markMethodProfiled(Executable method);
349
public void clearMethodState(Executable method) {
350
Objects.requireNonNull(method);
351
clearMethodState0(method);
352
}
353
public native void lockCompilation();
354
public native void unlockCompilation();
355
private native int getMethodEntryBci0(Executable method);
356
public int getMethodEntryBci(Executable method) {
357
Objects.requireNonNull(method);
358
return getMethodEntryBci0(method);
359
}
360
private native Object[] getNMethod0(Executable method, boolean isOsr);
361
public Object[] getNMethod(Executable method, boolean isOsr) {
362
Objects.requireNonNull(method);
363
return getNMethod0(method, isOsr);
364
}
365
public native long allocateCodeBlob(int size, int type);
366
public long allocateCodeBlob(long size, int type) {
367
int intSize = (int) size;
368
if ((long) intSize != size || size < 0) {
369
throw new IllegalArgumentException(
370
"size argument has illegal value " + size);
371
}
372
return allocateCodeBlob( intSize, type);
373
}
374
public native void freeCodeBlob(long addr);
375
public native void forceNMethodSweep();
376
public native Object[] getCodeHeapEntries(int type);
377
public native int getCompilationActivityMode();
378
private native long getMethodData0(Executable method);
379
public long getMethodData(Executable method) {
380
Objects.requireNonNull(method);
381
return getMethodData0(method);
382
}
383
public native Object[] getCodeBlob(long addr);
384
385
private native void clearInlineCaches0(boolean preserve_static_stubs);
386
public void clearInlineCaches() {
387
clearInlineCaches0(false);
388
}
389
public void clearInlineCaches(boolean preserve_static_stubs) {
390
clearInlineCaches0(preserve_static_stubs);
391
}
392
393
// Intered strings
394
public native boolean isInStringTable(String str);
395
396
// Memory
397
public native void readReservedMemory();
398
public native long allocateMetaspace(ClassLoader classLoader, long size);
399
public native long incMetaspaceCapacityUntilGC(long increment);
400
public native long metaspaceCapacityUntilGC();
401
public native long metaspaceSharedRegionAlignment();
402
403
// Metaspace Arena Tests
404
public native long createMetaspaceTestContext(long commit_limit, long reserve_limit);
405
public native void destroyMetaspaceTestContext(long context);
406
public native void purgeMetaspaceTestContext(long context);
407
public native void printMetaspaceTestContext(long context);
408
public native long getTotalCommittedWordsInMetaspaceTestContext(long context);
409
public native long getTotalUsedWordsInMetaspaceTestContext(long context);
410
public native long createArenaInTestContext(long context, boolean is_micro);
411
public native void destroyMetaspaceTestArena(long arena);
412
public native long allocateFromMetaspaceTestArena(long arena, long word_size);
413
public native void deallocateToMetaspaceTestArena(long arena, long p, long word_size);
414
415
public native long maxMetaspaceAllocationSize();
416
417
// Don't use these methods directly
418
// Use sun.hotspot.gc.GC class instead.
419
public native boolean isGCSupported(int name);
420
public native boolean isGCSupportedByJVMCICompiler(int name);
421
public native boolean isGCSelected(int name);
422
public native boolean isGCSelectedErgonomically();
423
424
// Force Young GC
425
public native void youngGC();
426
427
// Force Full GC
428
public native void fullGC();
429
430
// Returns true if the current GC supports concurrent collection control.
431
public native boolean supportsConcurrentGCBreakpoints();
432
433
private void checkConcurrentGCBreakpointsSupported() {
434
if (!supportsConcurrentGCBreakpoints()) {
435
throw new UnsupportedOperationException("Concurrent GC breakpoints not supported");
436
}
437
}
438
439
private native void concurrentGCAcquireControl0();
440
private native void concurrentGCReleaseControl0();
441
private native void concurrentGCRunToIdle0();
442
private native boolean concurrentGCRunTo0(String breakpoint);
443
444
private static boolean concurrentGCIsControlled = false;
445
private void checkConcurrentGCIsControlled() {
446
if (!concurrentGCIsControlled) {
447
throw new IllegalStateException("Not controlling concurrent GC");
448
}
449
}
450
451
// All collectors supporting concurrent GC breakpoints are expected
452
// to provide at least the following breakpoints.
453
public final String AFTER_MARKING_STARTED = "AFTER MARKING STARTED";
454
public final String BEFORE_MARKING_COMPLETED = "BEFORE MARKING COMPLETED";
455
456
// Collectors supporting concurrent GC breakpoints that do reference
457
// processing concurrently should provide the following breakpoint.
458
public final String AFTER_CONCURRENT_REFERENCE_PROCESSING_STARTED =
459
"AFTER CONCURRENT REFERENCE PROCESSING STARTED";
460
461
public void concurrentGCAcquireControl() {
462
checkConcurrentGCBreakpointsSupported();
463
if (concurrentGCIsControlled) {
464
throw new IllegalStateException("Already controlling concurrent GC");
465
}
466
concurrentGCAcquireControl0();
467
concurrentGCIsControlled = true;
468
}
469
470
public void concurrentGCReleaseControl() {
471
checkConcurrentGCBreakpointsSupported();
472
concurrentGCReleaseControl0();
473
concurrentGCIsControlled = false;
474
}
475
476
// Keep concurrent GC idle. Release from breakpoint.
477
public void concurrentGCRunToIdle() {
478
checkConcurrentGCBreakpointsSupported();
479
checkConcurrentGCIsControlled();
480
concurrentGCRunToIdle0();
481
}
482
483
// Allow concurrent GC to run to breakpoint.
484
// Throws IllegalStateException if reached end of cycle first.
485
public void concurrentGCRunTo(String breakpoint) {
486
concurrentGCRunTo(breakpoint, true);
487
}
488
489
// Allow concurrent GC to run to breakpoint.
490
// Returns true if reached breakpoint. If reached end of cycle first,
491
// then throws IllegalStateException if errorIfFail is true, returning
492
// false otherwise.
493
public boolean concurrentGCRunTo(String breakpoint, boolean errorIfFail) {
494
checkConcurrentGCBreakpointsSupported();
495
checkConcurrentGCIsControlled();
496
if (breakpoint == null) {
497
throw new NullPointerException("null breakpoint");
498
} else if (concurrentGCRunTo0(breakpoint)) {
499
return true;
500
} else if (errorIfFail) {
501
throw new IllegalStateException("Missed requested breakpoint \"" + breakpoint + "\"");
502
} else {
503
return false;
504
}
505
}
506
507
// Method tries to start concurrent mark cycle.
508
// It returns false if CM Thread is always in concurrent cycle.
509
public native boolean g1StartConcMarkCycle();
510
511
// Tests on ReservedSpace/VirtualSpace classes
512
public native int stressVirtualSpaceResize(long reservedSpaceSize, long magnitude, long iterations);
513
public native void readFromNoaccessArea();
514
public native long getThreadStackSize();
515
public native long getThreadRemainingStackSize();
516
517
// CPU features
518
public native String getCPUFeatures();
519
520
// VM flags
521
public native boolean isConstantVMFlag(String name);
522
public native boolean isLockedVMFlag(String name);
523
public native void setBooleanVMFlag(String name, boolean value);
524
public native void setIntVMFlag(String name, long value);
525
public native void setUintVMFlag(String name, long value);
526
public native void setIntxVMFlag(String name, long value);
527
public native void setUintxVMFlag(String name, long value);
528
public native void setUint64VMFlag(String name, long value);
529
public native void setSizeTVMFlag(String name, long value);
530
public native void setStringVMFlag(String name, String value);
531
public native void setDoubleVMFlag(String name, double value);
532
public native Boolean getBooleanVMFlag(String name);
533
public native Long getIntVMFlag(String name);
534
public native Long getUintVMFlag(String name);
535
public native Long getIntxVMFlag(String name);
536
public native Long getUintxVMFlag(String name);
537
public native Long getUint64VMFlag(String name);
538
public native Long getSizeTVMFlag(String name);
539
public native String getStringVMFlag(String name);
540
public native Double getDoubleVMFlag(String name);
541
private final List<Function<String,Object>> flagsGetters = Arrays.asList(
542
this::getBooleanVMFlag, this::getIntVMFlag, this::getUintVMFlag,
543
this::getIntxVMFlag, this::getUintxVMFlag, this::getUint64VMFlag,
544
this::getSizeTVMFlag, this::getStringVMFlag, this::getDoubleVMFlag);
545
546
public Object getVMFlag(String name) {
547
return flagsGetters.stream()
548
.map(f -> f.apply(name))
549
.filter(x -> x != null)
550
.findAny()
551
.orElse(null);
552
}
553
554
// Jigsaw
555
public native void DefineModule(Object module, boolean is_open, String version,
556
String location, Object[] packages);
557
public native void AddModuleExports(Object from_module, String pkg, Object to_module);
558
public native void AddReadsModule(Object from_module, Object source_module);
559
public native void AddModuleExportsToAllUnnamed(Object module, String pkg);
560
public native void AddModuleExportsToAll(Object module, String pkg);
561
562
public native int getOffsetForName0(String name);
563
public int getOffsetForName(String name) throws Exception {
564
int offset = getOffsetForName0(name);
565
if (offset == -1) {
566
throw new RuntimeException(name + " not found");
567
}
568
return offset;
569
}
570
public native Boolean getMethodBooleanOption(Executable method, String name);
571
public native Long getMethodIntxOption(Executable method, String name);
572
public native Long getMethodUintxOption(Executable method, String name);
573
public native Double getMethodDoubleOption(Executable method, String name);
574
public native String getMethodStringOption(Executable method, String name);
575
private final List<BiFunction<Executable,String,Object>> methodOptionGetters
576
= Arrays.asList(this::getMethodBooleanOption, this::getMethodIntxOption,
577
this::getMethodUintxOption, this::getMethodDoubleOption,
578
this::getMethodStringOption);
579
580
public Object getMethodOption(Executable method, String name) {
581
return methodOptionGetters.stream()
582
.map(f -> f.apply(method, name))
583
.filter(x -> x != null)
584
.findAny()
585
.orElse(null);
586
}
587
588
// Sharing & archiving
589
public native String getDefaultArchivePath();
590
public native boolean cdsMemoryMappingFailed();
591
public native boolean isSharingEnabled();
592
public native boolean isShared(Object o);
593
public native boolean isSharedClass(Class<?> c);
594
public native boolean areSharedStringsIgnored();
595
public native boolean isCDSIncluded();
596
public native boolean isJFRIncluded();
597
public native boolean isJavaHeapArchiveSupported();
598
public native Object getResolvedReferences(Class<?> c);
599
public native void linkClass(Class<?> c);
600
public native boolean areOpenArchiveHeapObjectsMapped();
601
602
// Compiler Directive
603
public native int addCompilerDirective(String compDirect);
604
public native void removeCompilerDirective(int count);
605
606
// Handshakes
607
public native int handshakeWalkStack(Thread t, boolean all_threads);
608
public native void asyncHandshakeWalkStack(Thread t);
609
610
// Returns true on linux if library has the noexecstack flag set.
611
public native boolean checkLibSpecifiesNoexecstack(String libfilename);
612
613
// Container testing
614
public native boolean isContainerized();
615
public native int validateCgroup(String procCgroups,
616
String procSelfCgroup,
617
String procSelfMountinfo);
618
public native void printOsInfo();
619
620
// Decoder
621
public native void disableElfSectionCache();
622
623
// Resolved Method Table
624
public native long resolvedMethodItemsCount();
625
626
// Protection Domain Table
627
public native int protectionDomainRemovedCount();
628
629
public native int getKlassMetadataSize(Class<?> c);
630
631
// ThreadSMR GC safety check for threadObj
632
public native void checkThreadObjOfTerminatingThread(Thread target);
633
634
// libc name
635
public native String getLibcName();
636
637
// Walk stack frames of current thread
638
public native void verifyFrames(boolean log, boolean updateRegisterMap);
639
640
public native boolean isJVMTIIncluded();
641
642
public native void waitUnsafe(int time_ms);
643
644
public native void lockCritical();
645
646
public native void unlockCritical();
647
}
648
649