public class CompilerToVMImpl extends Object implements CompilerToVM
| Constructor and Description |
|---|
CompilerToVMImpl() |
| 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) |
private int |
constantPoolRemapInstructionOperandFromCache0(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. |
private String |
getSymbol0(long metaspaceSymbol) |
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) |
private static void |
init()
Initializes the native part of the JVMCI runtime.
|
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 method) |
Object |
lookupAppendixInPool(long metaspaceConstantPool,
int cpi) |
private Object |
lookupAppendixInPool0(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) |
private int |
lookupKlassRefIndexInPool0(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) |
private String |
lookupNameRefInPool0(long metaspaceConstantPool,
int cpi) |
String |
lookupSignatureRefInPool(long metaspaceConstantPool,
int cpi) |
private String |
lookupSignatureRefInPool0(long metaspaceConstantPool,
int cpi) |
long |
lookupType(String name,
Class<?> accessingClass,
boolean eagerResolve)
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) |
private Object |
resolvePossiblyCachedConstantInPool0(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) |
public CompilerToVMImpl()
private static void init()
public int installCode(HotSpotCompiledCode compiledCode, InstalledCode code, SpeculationLog speculationLog)
CompilerToVMinstallCode in interface CompilerToVMcompiledCode - 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.public long getMetaspaceMethod(Class<?> holder, int slot)
CompilerToVMClass object and slot
number.getMetaspaceMethod in interface CompilerToVMholder - method holderslot - slot number of the methodpublic byte[] getBytecode(long metaspaceMethod)
CompilerToVMgetBytecode in interface CompilerToVMmetaspaceMethod - the metaspace Method objectpublic int exceptionTableLength(long metaspaceMethod)
exceptionTableLength in interface CompilerToVMpublic long exceptionTableStart(long metaspaceMethod)
exceptionTableStart in interface CompilerToVMpublic boolean hasBalancedMonitors(long metaspaceMethod)
CompilerToVMhasBalancedMonitors in interface CompilerToVMmetaspaceMethod - the metaspace Method object to querypublic long findUniqueConcreteMethod(long actualHolderMetaspaceKlass, long metaspaceMethod)
CompilerToVMResolvedJavaType.findUniqueConcreteMethod(ResolvedJavaMethod).findUniqueConcreteMethod in interface CompilerToVMactualHolderMetaspaceKlass - the best known type of receivermetaspaceMethod - the metaspace Method on which to based the searchmetaspaceMethodpublic long getKlassImplementor(long metaspaceKlass)
CompilerToVMgetKlassImplementor in interface CompilerToVMmetaspaceKlass - the metaspace klass to get the implementor formetaspaceKlass
) itself if there is more than one implementor.public long lookupType(String name, Class<?> accessingClass, boolean eagerResolve)
CompilerToVMlookupType in interface CompilerToVMname - a well formed Java type in internal formataccessingClass - the context of resolution (must not be null)eagerResolve - force resolution to a ResolvedJavaType. If true, this method will
either return a ResolvedJavaType or throw an exceptionnamepublic Object resolveConstantInPool(long metaspaceConstantPool, int cpi)
resolveConstantInPool in interface CompilerToVMpublic Object resolvePossiblyCachedConstantInPool(long metaspaceConstantPool, int cpi)
resolvePossiblyCachedConstantInPool in interface CompilerToVMprivate Object resolvePossiblyCachedConstantInPool0(long metaspaceConstantPool, int cpi)
public int lookupNameAndTypeRefIndexInPool(long metaspaceConstantPool, int cpi)
lookupNameAndTypeRefIndexInPool in interface CompilerToVMpublic String lookupNameRefInPool(long metaspaceConstantPool, int cpi)
lookupNameRefInPool in interface CompilerToVMprivate String lookupNameRefInPool0(long metaspaceConstantPool, int cpi)
public String lookupSignatureRefInPool(long metaspaceConstantPool, int cpi)
lookupSignatureRefInPool in interface CompilerToVMprivate String lookupSignatureRefInPool0(long metaspaceConstantPool, int cpi)
public int lookupKlassRefIndexInPool(long metaspaceConstantPool, int cpi)
lookupKlassRefIndexInPool in interface CompilerToVMprivate int lookupKlassRefIndexInPool0(long metaspaceConstantPool, int cpi)
public long constantPoolKlassAt(long metaspaceConstantPool, int cpi)
constantPoolKlassAt in interface CompilerToVMpublic long lookupKlassInPool(long metaspaceConstantPool, int cpi)
CompilerToVMlookupKlassInPool in interface CompilerToVMmetaspaceConstantPool - metaspace constant pool pointercpi - constant pool indexpublic long lookupMethodInPool(long metaspaceConstantPool, int cpi, byte opcode)
CompilerToVMlookupMethodInPool in interface CompilerToVMmetaspaceConstantPool - metaspace constant pool pointercpi - constant pool indexpublic long resolveField(long metaspaceConstantPool, int cpi, byte opcode, long[] info)
CompilerToVMinfo are:
[(int) flags, // only valid if field is resolved
(int) offset] // only valid if field is resolved
resolveField in interface CompilerToVMmetaspaceConstantPool - metaspace constant pool pointercpi - constant pool indexinfo - an array in which the details of the field are returnedpublic int constantPoolRemapInstructionOperandFromCache(long metaspaceConstantPool, int cpi)
constantPoolRemapInstructionOperandFromCache in interface CompilerToVMprivate int constantPoolRemapInstructionOperandFromCache0(long metaspaceConstantPool, int cpi)
public Object lookupAppendixInPool(long metaspaceConstantPool, int cpi)
lookupAppendixInPool in interface CompilerToVMprivate Object lookupAppendixInPool0(long metaspaceConstantPool, int cpi)
public void initializeConfiguration(HotSpotVMConfig config)
initializeConfiguration in interface CompilerToVMpublic long resolveMethod(long metaspaceKlassExactReceiver, long metaspaceMethod, long metaspaceKlassCaller)
resolveMethod in interface CompilerToVMpublic boolean hasFinalizableSubclass(long metaspaceKlass)
hasFinalizableSubclass in interface CompilerToVMpublic boolean methodIsIgnoredBySecurityStackWalk(long metaspaceMethod)
CompilerToVMmethodIsIgnoredBySecurityStackWalk in interface CompilerToVMmetaspaceMethod - the metaspace Method objectpublic long getClassInitializer(long metaspaceKlass)
getClassInitializer in interface CompilerToVMpublic long getMaxCallTargetOffset(long address)
getMaxCallTargetOffset in interface CompilerToVMpublic String disassembleCodeBlob(long codeBlob)
disassembleCodeBlob in interface CompilerToVMpublic StackTraceElement getStackTraceElement(long metaspaceMethod, int bci)
getStackTraceElement in interface CompilerToVMpublic Object executeCompiledMethodVarargs(Object[] args, InstalledCode hotspotInstalledCode)
executeCompiledMethodVarargs in interface CompilerToVMpublic long[] getLineNumberTable(long metaspaceMethod)
getLineNumberTable in interface CompilerToVMpublic long getLocalVariableTableStart(long metaspaceMethod)
getLocalVariableTableStart in interface CompilerToVMpublic int getLocalVariableTableLength(long metaspaceMethod)
getLocalVariableTableLength in interface CompilerToVMpublic String getFileName(HotSpotResolvedJavaType method)
getFileName in interface CompilerToVMpublic void reprofile(long metaspaceMethod)
CompilerToVMreprofile in interface CompilerToVMmetaspaceMethod - the metaspace Method objectpublic void invalidateInstalledCode(InstalledCode hotspotInstalledCode)
invalidateInstalledCode in interface CompilerToVMpublic Class<?> getJavaMirror(long metaspaceKlass)
getJavaMirror in interface CompilerToVMpublic long readUnsafeKlassPointer(Object o)
readUnsafeKlassPointer in interface CompilerToVMpublic Object readUncompressedOop(long address)
CompilerToVMHotSpotVMField 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.readUncompressedOop in interface CompilerToVMaddress - address of an oop field within a VM data structurepublic void doNotInlineOrCompile(long metaspaceMethod)
doNotInlineOrCompile in interface CompilerToVMpublic Object executeCompiledMethod(Object arg1, Object arg2, Object arg3, InstalledCode hotspotInstalledCode) throws InvalidInstalledCodeException
executeCompiledMethod in interface CompilerToVMInvalidInstalledCodeExceptionpublic void notifyCompilationStatistics(int id, HotSpotResolvedJavaMethod method, boolean osr, int processedBytecodes, long time, long timeUnitsPerSecond, InstalledCode installedCode)
CompilerToVMnotifyCompilationStatistics in interface CompilerToVMid - 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 methodtimeUnitsPerSecond - the granularity of the units for the time valueinstalledCode - the nmethod installed as a result of the compilationpublic void resetCompilationStatistics()
resetCompilationStatistics in interface CompilerToVMpublic long[] collectCounters()
CompilerToVMcollectCounters in interface CompilerToVMpublic boolean isMature(long method)
isMature in interface CompilerToVMpublic int allocateCompileId(long metaspaceMethod, int entryBCI)
CompilerToVMallocateCompileId in interface CompilerToVMpublic String getGPUs()
CompilerToVMgetGPUs in interface CompilerToVMpublic boolean canInlineMethod(long metaspaceMethod)
CompilerToVMcanInlineMethod in interface CompilerToVMmetaspaceMethod - the metaspace Method object to querypublic boolean shouldInlineMethod(long metaspaceMethod)
CompilerToVMshouldInlineMethod in interface CompilerToVMmetaspaceMethod - the metaspace Method object to querypublic boolean hasCompiledCodeForOSR(long metaspaceMethod, int entryBCI, int level)
hasCompiledCodeForOSR in interface CompilerToVMmetaspaceMethod - the method to checklevel - the compilation levelmetaspaceMethod has code for levelpublic HotSpotStackFrameReference getNextStackFrame(HotSpotStackFrameReference frame, long[] methods, int initialSkip)
CompilerToVMgetNextStackFrame in interface CompilerToVMframe - 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 searchpublic void materializeVirtualObjects(HotSpotStackFrameReference stackFrame, boolean invalidate)
CompilerToVMmaterializeVirtualObjects in interface CompilerToVMinvalidate - if true, the compiled method for the stack frame will be
invalidated.public long getTimeStamp()
CompilerToVMgetTimeStamp in interface CompilerToVMpublic String getSymbol(long metaspaceSymbol)
CompilerToVMSymbol as a String.getSymbol in interface CompilerToVMprivate String getSymbol0(long metaspaceSymbol)
public void resolveInvokeDynamic(long metaspaceConstantPool, int index)
resolveInvokeDynamic in interface CompilerToVMpublic void resolveInvokeHandle(long metaspaceConstantPool, int index)
resolveInvokeHandle in interface CompilerToVMpublic int getVtableIndexForInterface(long metaspaceKlass, long metaspaceMethod)
getVtableIndexForInterface in interface CompilerToVMpublic boolean shouldDebugNonSafepoints()
shouldDebugNonSafepoints in interface CompilerToVMpublic void writeDebugOutput(byte[] bytes, int offset, int length)
writeDebugOutput in interface CompilerToVMpublic void flushDebugOutput()
flushDebugOutput in interface CompilerToVM