public class SubstrateOptimizedCallTarget extends org.graalvm.compiler.truffle.runtime.OptimizedCallTarget implements SubstrateCompilableTruffleAST
SubstrateOptimizedCallTargetInstalledCode
. At most one piece of code is
valid as an entry point for new invocations at any given time, but arbitrarily many
pieces of code for this call target can be alive at the same time (for example, from
previous lower-tier compilations).
Assume that methods such as SubstrateOptimizedCallTarget.isValid()
or SubstrateOptimizedCallTarget.getCodeAddress()
return stale values
because internal state can change at any safepoint. Consistent reads of such values require
ensuring the absence of safepoint checks and preventing floating reads and read elimination.
Modifier and Type | Field and Description |
---|---|
protected SubstrateOptimizedCallTargetInstalledCode |
installedCode
Stores the most recently installed code, which is the only entry point for this call target
at one point in time (or not an entry point, if invalid).
|
Constructor and Description |
---|
SubstrateOptimizedCallTarget(org.graalvm.compiler.truffle.runtime.OptimizedCallTarget sourceCallTarget,
com.oracle.truffle.api.nodes.RootNode rootNode) |
accept, asJavaConstant, calculateNonTrivialNodes, call, callBoundary, callDirect, callIndirect, callInlined, callOSR, compile, computeBlockCompilations, createFrame, dequeueInlined, ensureInitialized, equals, firstTierCall, getCallAndLoopCount, getCallCount, getCallNodes, getCallSiteForSplit, getCompilerOptions, getDebugProperties, getInitializedArgumentsProfile, getInitializedReturnProfile, getInitializedTimestamp, getKnownCallSiteCount, getName, getNodeRewritingAssumptionConstant, getNonTrivialNodeCount, getOptionValue, getOptionValues, getRootNode, getSingleCallNode, getSourceCallTarget, getValidRootAssumptionConstant, hashCode, injectArgumentsProfile, invalidate, isInitialized, isSameOrSplit, isSingleCaller, isSplit, isSubmittedForCompilation, isTrivial, log, maybeWaitForTask, needsCompile, nodeReplaced, onCompilationFailed, prepareForAOT, profileArguments, profiledPERoot, resetCompilationProfile, resetNeedsSplit, runtime, shouldCompile, stopProfilingArguments, toString, waitForCompilation, wasExecuted
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
asJavaConstant, dequeueInlined, getCallCount, getCallNodes, getKnownCallSiteCount, getName, getNodeRewritingAssumptionConstant, getNonTrivialNodeCount, getValidRootAssumptionConstant, isSameOrSplit, isTrivial, onCompilationFailed, serializeException
protected SubstrateOptimizedCallTargetInstalledCode installedCode
null
.
Does not need to be volatile because it is modified only in safepoint operations. Reads of this field must be done carefully placed so they cannot float across safepoint checks.
public SubstrateOptimizedCallTarget(org.graalvm.compiler.truffle.runtime.OptimizedCallTarget sourceCallTarget, com.oracle.truffle.api.nodes.RootNode rootNode)
public SubstrateSpeculationLog getSpeculationLog()
getSpeculationLog
in class org.graalvm.compiler.truffle.runtime.OptimizedCallTarget
public jdk.vm.ci.meta.SpeculationLog getCompilationSpeculationLog()
getCompilationSpeculationLog
in interface org.graalvm.compiler.truffle.common.CompilableTruffleAST
public boolean isValid()
isValid
in class org.graalvm.compiler.truffle.runtime.OptimizedCallTarget
public boolean isValidLastTier()
isValidLastTier
in class org.graalvm.compiler.truffle.runtime.OptimizedCallTarget
public long getCodeAddress()
getCodeAddress
in class org.graalvm.compiler.truffle.runtime.OptimizedCallTarget
public static void safepointBarrier()
SubstrateTruffleGraphBuilderPlugins
.public Object doInvoke(Object[] args)
doInvoke
in class org.graalvm.compiler.truffle.runtime.OptimizedCallTarget
public boolean cancelCompilation(CharSequence reason)
cancelCompilation
in interface org.graalvm.compiler.truffle.common.CompilableTruffleAST
cancelCompilation
in class org.graalvm.compiler.truffle.runtime.OptimizedCallTarget
public jdk.vm.ci.code.InstalledCode createPreliminaryInstalledCode()
SubstrateCompilableTruffleAST
InstalledCode
object for code installation, as required by
infrastructure, but this object does not need to be the same SubstrateInstalledCode
object that is eventually installed in the code cache. Once the provisional object is passed
to SubstrateCodeCacheProvider
, it creates the final SubstrateInstalledCode
object and invokes SubstrateInstalledCode.setAddress(long, jdk.vm.ci.meta.ResolvedJavaMethod)
on it.createPreliminaryInstalledCode
in interface SubstrateCompilableTruffleAST
SubstrateCodeCacheProvider
public SubstrateOptimizedCallTargetInstalledCode createSubstrateInstalledCode()
createSubstrateInstalledCode
in interface SubstrateInstalledCode.Factory
protected void onCodeInstalled(SubstrateOptimizedCallTargetInstalledCode code)
SubstrateOptimizedCallTargetInstalledCode.setAddress(long, jdk.vm.ci.meta.ResolvedJavaMethod)
for code
representing this call target.protected void onCodeCleared(SubstrateOptimizedCallTargetInstalledCode code)
SubstrateOptimizedCallTargetInstalledCode.clearAddress()
for code
representing this call target. The caller can, however, be older code and not the current
entry point, so that code != installedCode
.protected SubstrateOptimizedCallTargetInstalledCode createInitializationInstalledCode()
SubstrateOptimizedCallTarget.installedCode
so it is never null
.