Class HotSpotTruffleRuntime
java.lang.Object
com.oracle.truffle.runtime.OptimizedTruffleRuntime
com.oracle.truffle.runtime.hotspot.HotSpotTruffleRuntime
- All Implemented Interfaces:
com.oracle.truffle.api.TruffleRuntime,com.oracle.truffle.compiler.TruffleCompilerRuntime
HotSpot specific implementation of a Graal-enabled Truffle runtime.
This class contains functionality for interfacing with a HotSpot-based Truffle compiler,
independent of where the compiler resides (i.e., co-located in the HotSpot heap or running in a
native-image shared library).
-
Nested Class Summary
Nested classes/interfaces inherited from class com.oracle.truffle.runtime.OptimizedTruffleRuntime
OptimizedTruffleRuntime.KnownMethods, OptimizedTruffleRuntime.StackTraceHelperNested classes/interfaces inherited from interface com.oracle.truffle.compiler.TruffleCompilerRuntime
com.oracle.truffle.compiler.TruffleCompilerRuntime.InlineKind, com.oracle.truffle.compiler.TruffleCompilerRuntime.LoopExplosionKind -
Field Summary
Fields inherited from class com.oracle.truffle.runtime.OptimizedTruffleRuntime
compilationSupport, engineOptions, initializeCallTarget, knownMethods, MAX_JDK_VERSION, MIN_COMPILER_VERSION, MIN_JDK_VERSION, NEXT_VERSION_UPDATE, truffleCompiler -
Constructor Summary
ConstructorsConstructorDescriptionHotSpotTruffleRuntime(com.oracle.truffle.compiler.TruffleCompilationSupport compilationSupport) -
Method Summary
Modifier and TypeMethodDescriptionprotected <T> TvoidNotifies this runtime when a Truffle AST is being executed in the Truffle interpreter even though compiled code is available for the AST.booleanprotected OptimizedCallTargetcreateOptimizedCallTarget(OptimizedCallTarget source, com.oracle.truffle.api.nodes.RootNode rootNode) jdk.vm.ci.meta.SpeculationLogCreates a log thatHotSpotSpeculationLog#managesFailedSpeculations() managesa native failed speculations list.protected jdk.vm.ci.meta.JavaConstantprotected intgetArrayBaseOffset(Class<?> componentType) protected intgetArrayIndexScale(Class<?> componentType) protected intgetBaseInstanceSize(Class<?> type) protected com.oracle.truffle.api.impl.AbstractFastThreadLocalprotected int[]getFieldOffsets(Class<?> type, boolean includePrimitive, boolean includeSuperclasses) intprotected intstatic HotSpotTruffleRuntimeprotected jdk.vm.ci.code.stack.StackIntrospectionlongcom.oracle.truffle.api.impl.ThreadLocalHandshakecom.oracle.truffle.compiler.TruffleCompilergetTruffleCompiler(com.oracle.truffle.compiler.TruffleCompilable compilable) This is called reflectively from the compiler side in HotSpotTruffleHostEnvironment.booleanbooleanvoidvoidonCodeInstallation(com.oracle.truffle.compiler.TruffleCompilable compilable, jdk.vm.ci.code.InstalledCode installedCode) voidstatic voidsetDontInlineCallBoundaryMethod(List<jdk.vm.ci.meta.ResolvedJavaMethod> callBoundaryMethods) Methods inherited from class com.oracle.truffle.runtime.OptimizedTruffleRuntime
addListener, asCompilableTruffleAST, clearState, compilationThresholdScale, createAssumption, createAssumption, createLoopNode, createMaterializedFrame, createMaterializedFrame, createTerminatingThreadLocal, createVirtualFrame, doCompile, existsCompilerOption, finishCompilation, getCapability, getCompilationQueueSize, getCompilerConfigurationName, getCompilerIdleDelay, getConstantFieldInfo, getEngineCacheSupport, getEngineData, getFrameMaterializeCalled, getHostMethodInfo, getListener, getLookupTypes, getLoopNodeFactory, getName, getPartialEvaluationMethodInfo, getTestTvmci, getTvmci, initializeEngineCacheSupport, initializeKnownMethods, installDefaultListeners, isSuppressedFailure, isValueType, iterateFrames, listCompilerOptions, loadEngineCacheSupport, log, markFrameMaterializeCalled, newTruffleCompiler, openCompilerThreadScope, printStackTraceToString, registerOptimizedAssumptionDependency, removeListener, resolveType, submitForCompilation, validateCompilerOption, waitForCompilationMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.oracle.truffle.compiler.TruffleCompilerRuntime
formatEvent, log, logEvent, logEvent, resolveTypeMethods inherited from interface com.oracle.truffle.api.TruffleRuntime
createDirectCallNode, createIndirectCallNode, iterateFrames
-
Constructor Details
-
HotSpotTruffleRuntime
public HotSpotTruffleRuntime(com.oracle.truffle.compiler.TruffleCompilationSupport compilationSupport)
-
-
Method Details
-
getJVMCIReservedLongOffset0
public int getJVMCIReservedLongOffset0() -
getThreadLocalHandshake
public com.oracle.truffle.api.impl.ThreadLocalHandshake getThreadLocalHandshake()- Specified by:
getThreadLocalHandshakein classOptimizedTruffleRuntime
-
getStackIntrospection
protected jdk.vm.ci.code.stack.StackIntrospection getStackIntrospection()- Specified by:
getStackIntrospectionin classOptimizedTruffleRuntime
-
getTruffleCompiler
public com.oracle.truffle.compiler.TruffleCompiler getTruffleCompiler(com.oracle.truffle.compiler.TruffleCompilable compilable) This is called reflectively from the compiler side in HotSpotTruffleHostEnvironment.- Specified by:
getTruffleCompilerin classOptimizedTruffleRuntime
-
resetCompiler
public void resetCompiler() -
createOptimizedCallTarget
public OptimizedCallTarget createOptimizedCallTarget(OptimizedCallTarget source, com.oracle.truffle.api.nodes.RootNode rootNode) - Specified by:
createOptimizedCallTargetin classOptimizedTruffleRuntime
-
createInitializationCallTarget
- Specified by:
createInitializationCallTargetin classOptimizedTruffleRuntime
-
onCodeInstallation
public void onCodeInstallation(com.oracle.truffle.compiler.TruffleCompilable compilable, jdk.vm.ci.code.InstalledCode installedCode) -
createSpeculationLog
public jdk.vm.ci.meta.SpeculationLog createSpeculationLog()Creates a log thatHotSpotSpeculationLog#managesFailedSpeculations() managesa native failed speculations list. An important invariant is that an nmethod compiled with this log can never be executing once the log object dies. When the log object dies, it frees the failed speculations list thus invalidating theHotSpotSpeculationLog#getFailedSpeculationsAddress() failed speculations addressembedded in the nmethod. If the nmethod were to execute after this point and fail a speculation, it would append the failed speculation to the already freed list.Truffle ensures this cannot happen as it only attaches managed speculation logs to
OptimizedCallTargets andOptimizedOSRLoopNodes. Executions of nmethods compiled for anOptimizedCallTargetorOptimizedOSRLoopNodeobject will have a strong reference to the object (i.e., as the receiver). This guarantees that such an nmethod cannot be executing after the object has died.- Specified by:
createSpeculationLogin classOptimizedTruffleRuntime
-
setDontInlineCallBoundaryMethod
public static void setDontInlineCallBoundaryMethod(List<jdk.vm.ci.meta.ResolvedJavaMethod> callBoundaryMethods) -
getCompileQueue
- Specified by:
getCompileQueuein classOptimizedTruffleRuntime
-
bypassedInstalledCode
Description copied from class:OptimizedTruffleRuntimeNotifies this runtime when a Truffle AST is being executed in the Truffle interpreter even though compiled code is available for the AST. If this runtime uses a special entry point to switch to compiled Truffle code, then this means the code with the special entry point was deoptimized or otherwise removed from the code cache and needs to be re-installed.- Overrides:
bypassedInstalledCodein classOptimizedTruffleRuntime
-
bypassedReservedOop
public boolean bypassedReservedOop() -
getKnownMethods
- Overrides:
getKnownMethodsin classOptimizedTruffleRuntime
-
notifyTransferToInterpreter
public void notifyTransferToInterpreter() -
isProfilingEnabled
public boolean isProfilingEnabled() -
forObject
- Specified by:
forObjectin classOptimizedTruffleRuntime
-
getBaseInstanceSize
- Overrides:
getBaseInstanceSizein classOptimizedTruffleRuntime
-
getFieldOffsets
protected int[] getFieldOffsets(Class<?> type, boolean includePrimitive, boolean includeSuperclasses) - Overrides:
getFieldOffsetsin classOptimizedTruffleRuntime
-
getObjectAlignment
protected int getObjectAlignment()- Overrides:
getObjectAlignmentin classOptimizedTruffleRuntime
-
getArrayIndexScale
- Overrides:
getArrayIndexScalein classOptimizedTruffleRuntime
-
getArrayBaseOffset
- Overrides:
getArrayBaseOffsetin classOptimizedTruffleRuntime
-
getStackOverflowLimit
public long getStackOverflowLimit()- Overrides:
getStackOverflowLimitin classOptimizedTruffleRuntime
-
asObject
- Specified by:
asObjectin classOptimizedTruffleRuntime
-
getFastThreadLocalImpl
protected com.oracle.truffle.api.impl.AbstractFastThreadLocal getFastThreadLocalImpl()- Specified by:
getFastThreadLocalImplin classOptimizedTruffleRuntime
-
getRuntime
-
isLibGraalCompilationEnabled
public boolean isLibGraalCompilationEnabled()
-