public interface CompilerToVM
Modifier and Type | Method and Description |
---|---|
int |
allocateCompileId(long metaspaceMethod,
int entryBCI)
Generate a unique id to identify the result of the compile.
|
boolean |
canInlineMethod(long metaspaceMethod)
Determines if a given metaspace Method can be inlined.
|
long[] |
collectCounters()
Collects the current values of all JVMCI benchmark counters, summed up over all threads.
|
long |
constantPoolKlassAt(long metaspaceConstantPool,
int cpi) |
int |
constantPoolRemapInstructionOperandFromCache(long metaspaceConstantPool,
int cpi) |
String |
disassembleCodeBlob(long codeBlob) |
void |
doNotInlineOrCompile(long metaspaceMethod) |
int |
exceptionTableLength(long metaspaceMethod) |
long |
exceptionTableStart(long metaspaceMethod) |
Object |
executeCompiledMethod(Object arg1,
Object arg2,
Object arg3,
InstalledCode hotspotInstalledCode) |
Object |
executeCompiledMethodVarargs(Object[] args,
InstalledCode hotspotInstalledCode) |
long |
findUniqueConcreteMethod(long actualHolderMetaspaceKlass,
long metaspaceMethod)
Used to implement
ResolvedJavaType.findUniqueConcreteMethod(ResolvedJavaMethod) . |
void |
flushDebugOutput() |
byte[] |
getBytecode(long metaspaceMethod)
Copies the original bytecode of a given method into a new byte array and returns it.
|
long |
getClassInitializer(long metaspaceKlass) |
String |
getFileName(HotSpotResolvedJavaType method) |
String |
getGPUs()
Gets the names of the supported GPU architectures.
|
Class<?> |
getJavaMirror(long metaspaceKlass) |
long |
getKlassImplementor(long metaspaceKlass)
Returns the implementor for the given interface class, if there is a single implementor.
|
long[] |
getLineNumberTable(long metaspaceMethod) |
int |
getLocalVariableTableLength(long metaspaceMethod) |
long |
getLocalVariableTableStart(long metaspaceMethod) |
long |
getMaxCallTargetOffset(long address) |
long |
getMetaspaceMethod(Class<?> holder,
int slot)
Gets the metaspace Method object corresponding to a given
Class object and slot
number. |
HotSpotStackFrameReference |
getNextStackFrame(HotSpotStackFrameReference frame,
long[] methods,
int initialSkip)
Looks for the next Java stack frame with the given method.
|
StackTraceElement |
getStackTraceElement(long metaspaceMethod,
int bci) |
String |
getSymbol(long metaspaceSymbol)
Gets the value of a metaspace
Symbol as a String. |
long |
getTimeStamp()
Fetch the time stamp used for printing inside hotspot.
|
int |
getVtableIndexForInterface(long metaspaceKlass,
long metaspaceMethod) |
boolean |
hasBalancedMonitors(long metaspaceMethod)
Determines if a given metaspace Method object has balanced monitors.
|
boolean |
hasCompiledCodeForOSR(long metaspaceMethod,
int entryBCI,
int level) |
boolean |
hasFinalizableSubclass(long metaspaceKlass) |
void |
initializeConfiguration(HotSpotVMConfig config) |
int |
installCode(HotSpotCompiledCode compiledCode,
InstalledCode code,
SpeculationLog speculationLog)
Installs the result of a compilation into the code cache.
|
void |
invalidateInstalledCode(InstalledCode hotspotInstalledCode) |
boolean |
isMature(long metaspaceMethodData) |
Object |
lookupAppendixInPool(long metaspaceConstantPool,
int cpi) |
long |
lookupKlassInPool(long metaspaceConstantPool,
int cpi)
Looks up a class entry in a constant pool.
|
int |
lookupKlassRefIndexInPool(long metaspaceConstantPool,
int cpi) |
long |
lookupMethodInPool(long metaspaceConstantPool,
int cpi,
byte opcode)
Looks up a method entry in a constant pool.
|
int |
lookupNameAndTypeRefIndexInPool(long metaspaceConstantPool,
int cpi) |
String |
lookupNameRefInPool(long metaspaceConstantPool,
int cpi) |
String |
lookupSignatureRefInPool(long metaspaceConstantPool,
int cpi) |
long |
lookupType(String name,
Class<?> accessingClass,
boolean resolve)
Converts a name to a metaspace klass.
|
void |
materializeVirtualObjects(HotSpotStackFrameReference stackFrame,
boolean invalidate)
Materialized all virtual objects within the given stack frame and update the locals within
the given stackFrame object.
|
boolean |
methodIsIgnoredBySecurityStackWalk(long metaspaceMethod)
Determines if a given metaspace method is ignored by security stack walks.
|
void |
notifyCompilationStatistics(int id,
HotSpotResolvedJavaMethod method,
boolean osr,
int processedBytecodes,
long time,
long timeUnitsPerSecond,
InstalledCode installedCode)
Notifies the VM of statistics for a completed compilation.
|
Object |
readUncompressedOop(long address)
Reads an object pointer within a VM data structure.
|
long |
readUnsafeKlassPointer(Object o) |
void |
reprofile(long metaspaceMethod)
Invalidates the profiling information and restarts profiling upon the next invocation.
|
void |
resetCompilationStatistics() |
Object |
resolveConstantInPool(long metaspaceConstantPool,
int cpi) |
long |
resolveField(long metaspaceConstantPool,
int cpi,
byte opcode,
long[] info)
Looks up a field entry in a constant pool and attempts to resolve it.
|
void |
resolveInvokeDynamic(long metaspaceConstantPool,
int index) |
void |
resolveInvokeHandle(long metaspaceConstantPool,
int index) |
long |
resolveMethod(long metaspaceKlassExactReceiver,
long metaspaceMethod,
long metaspaceKlassCaller) |
Object |
resolvePossiblyCachedConstantInPool(long metaspaceConstantPool,
int cpi) |
boolean |
shouldDebugNonSafepoints() |
boolean |
shouldInlineMethod(long metaspaceMethod)
Determines if a given metaspace Method should be inlined at any cost.
|
void |
writeDebugOutput(byte[] bytes,
int offset,
int length) |
byte[] getBytecode(long metaspaceMethod)
metaspaceMethod
- the metaspace Method objectint exceptionTableLength(long metaspaceMethod)
long exceptionTableStart(long metaspaceMethod)
boolean hasBalancedMonitors(long metaspaceMethod)
metaspaceMethod
- the metaspace Method object to queryboolean canInlineMethod(long metaspaceMethod)
metaspaceMethod
- the metaspace Method object to queryboolean shouldInlineMethod(long metaspaceMethod)
metaspaceMethod
- the metaspace Method object to querylong findUniqueConcreteMethod(long actualHolderMetaspaceKlass, long metaspaceMethod)
ResolvedJavaType.findUniqueConcreteMethod(ResolvedJavaMethod)
.metaspaceMethod
- the metaspace Method on which to based the searchactualHolderMetaspaceKlass
- the best known type of receivermetaspaceMethod
long getKlassImplementor(long metaspaceKlass)
metaspaceKlass
- the metaspace klass to get the implementor formetaspaceKlass
) itself if there is more than one implementor.boolean methodIsIgnoredBySecurityStackWalk(long metaspaceMethod)
metaspaceMethod
- the metaspace Method objectlong lookupType(String name, Class<?> accessingClass, boolean resolve)
name
- a well formed Java type in internal formataccessingClass
- the context of resolution (must not be null)resolve
- force resolution to a ResolvedJavaType
. If true, this method will
either return a ResolvedJavaType
or throw an exceptionname
LinkageError
- if resolve == true
and the resolution failedObject resolveConstantInPool(long metaspaceConstantPool, int cpi)
Object resolvePossiblyCachedConstantInPool(long metaspaceConstantPool, int cpi)
int lookupNameAndTypeRefIndexInPool(long metaspaceConstantPool, int cpi)
String lookupNameRefInPool(long metaspaceConstantPool, int cpi)
String lookupSignatureRefInPool(long metaspaceConstantPool, int cpi)
int lookupKlassRefIndexInPool(long metaspaceConstantPool, int cpi)
long constantPoolKlassAt(long metaspaceConstantPool, int cpi)
long lookupKlassInPool(long metaspaceConstantPool, int cpi)
metaspaceConstantPool
- metaspace constant pool pointercpi
- constant pool indexlong lookupMethodInPool(long metaspaceConstantPool, int cpi, byte opcode)
metaspaceConstantPool
- metaspace constant pool pointercpi
- constant pool indexlong resolveField(long metaspaceConstantPool, int cpi, byte opcode, long[] info)
info
are:
[(int) flags, // only valid if field is resolved (int) offset] // only valid if field is resolved
metaspaceConstantPool
- metaspace constant pool pointercpi
- constant pool indexinfo
- an array in which the details of the field are returnedint constantPoolRemapInstructionOperandFromCache(long metaspaceConstantPool, int cpi)
Object lookupAppendixInPool(long metaspaceConstantPool, int cpi)
int installCode(HotSpotCompiledCode compiledCode, InstalledCode code, SpeculationLog speculationLog)
compiledCode
- the result of a compilationcode
- the details of the installed CodeBlob are written to this objectHotSpotVMConfig.codeInstallResultOk
,
HotSpotVMConfig.codeInstallResultCacheFull
,
HotSpotVMConfig.codeInstallResultCodeTooLarge
,
HotSpotVMConfig.codeInstallResultDependenciesFailed
or
HotSpotVMConfig.codeInstallResultDependenciesInvalid
.void notifyCompilationStatistics(int id, HotSpotResolvedJavaMethod method, boolean osr, int processedBytecodes, long time, long timeUnitsPerSecond, InstalledCode installedCode)
id
- the identifier of the compilationmethod
- the method compiledosr
- specifies if the compilation was for on-stack-replacementprocessedBytecodes
- the number of bytecodes processed during the compilation, including
the bytecodes of all inlined methodstime
- the amount time spent compiling method
timeUnitsPerSecond
- the granularity of the units for the time
valueinstalledCode
- the nmethod installed as a result of the compilationvoid resetCompilationStatistics()
void initializeConfiguration(HotSpotVMConfig config)
long resolveMethod(long metaspaceKlassExactReceiver, long metaspaceMethod, long metaspaceKlassCaller)
long getClassInitializer(long metaspaceKlass)
boolean hasFinalizableSubclass(long metaspaceKlass)
long getMetaspaceMethod(Class<?> holder, int slot)
Class
object and slot
number.holder
- method holderslot
- slot number of the methodlong getMaxCallTargetOffset(long address)
String disassembleCodeBlob(long codeBlob)
StackTraceElement getStackTraceElement(long metaspaceMethod, int bci)
Object executeCompiledMethod(Object arg1, Object arg2, Object arg3, InstalledCode hotspotInstalledCode) throws InvalidInstalledCodeException
InvalidInstalledCodeException
Object executeCompiledMethodVarargs(Object[] args, InstalledCode hotspotInstalledCode) throws InvalidInstalledCodeException
InvalidInstalledCodeException
long[] getLineNumberTable(long metaspaceMethod)
long getLocalVariableTableStart(long metaspaceMethod)
int getLocalVariableTableLength(long metaspaceMethod)
String getFileName(HotSpotResolvedJavaType method)
Class<?> getJavaMirror(long metaspaceKlass)
long readUnsafeKlassPointer(Object o)
Object readUncompressedOop(long address)
HotSpotVMField
whose
type
is "oop"
(e.g.,
ArrayKlass::_component_mirror
, Klass::_java_mirror
,
JavaThread::_threadObj
).
Note that Unsafe.getObject(Object, long)
cannot be used for this since it does a
narrowOop
read if the VM is using compressed oops whereas oops within VM data
structures are (currently) always uncompressed.address
- address of an oop field within a VM data structurevoid doNotInlineOrCompile(long metaspaceMethod)
void reprofile(long metaspaceMethod)
metaspaceMethod
- the metaspace Method objectvoid invalidateInstalledCode(InstalledCode hotspotInstalledCode)
long[] collectCounters()
boolean isMature(long metaspaceMethodData)
int allocateCompileId(long metaspaceMethod, int entryBCI)
String getGPUs()
boolean hasCompiledCodeForOSR(long metaspaceMethod, int entryBCI, int level)
metaspaceMethod
- the method to checkentryBCI
- level
- the compilation levelmetaspaceMethod
has code for level
long getTimeStamp()
String getSymbol(long metaspaceSymbol)
Symbol
as a String.metaspaceSymbol
- HotSpotStackFrameReference getNextStackFrame(HotSpotStackFrameReference frame, long[] methods, int initialSkip)
frame
- the starting point of the search, where null
refers to the topmost framemethods
- the metaspace methods to look for, where null
means that any frame is
returnednull
if the end of the stack was reached during the searchvoid materializeVirtualObjects(HotSpotStackFrameReference stackFrame, boolean invalidate)
invalidate
- if true
, the compiled method for the stack frame will be
invalidated.void resolveInvokeDynamic(long metaspaceConstantPool, int index)
void resolveInvokeHandle(long metaspaceConstantPool, int index)
int getVtableIndexForInterface(long metaspaceKlass, long metaspaceMethod)
boolean shouldDebugNonSafepoints()
void writeDebugOutput(byte[] bytes, int offset, int length)
void flushDebugOutput()