Class HotSpotOptimizedCallTarget
java.lang.Object
com.oracle.truffle.runtime.OptimizedCallTarget
com.oracle.truffle.runtime.hotspot.HotSpotOptimizedCallTarget
- All Implemented Interfaces:
com.oracle.truffle.api.CallTarget, com.oracle.truffle.api.ReplaceObserver, com.oracle.truffle.api.RootCallTarget, com.oracle.truffle.compiler.TruffleCompilable
A HotSpot specific
OptimizedCallTarget whose machine code (if any) is represented by an
associated InstalledCode.-
Nested Class Summary
Nested classes/interfaces inherited from class OptimizedCallTarget
OptimizedCallTarget.ArgumentsProfile, OptimizedCallTarget.ReturnProfile -
Field Summary
Fields inherited from class OptimizedCallTarget
engine, id, initialized, speculationLog -
Constructor Summary
ConstructorsConstructorDescriptionHotSpotOptimizedCallTarget(EngineData engine) HotSpotOptimizedCallTarget(OptimizedCallTarget sourceCallTarget, com.oracle.truffle.api.nodes.RootNode rootNode) -
Method Summary
Modifier and TypeMethodDescriptionlongGets the address of the machine code for this call target.jdk.vm.ci.meta.SpeculationLogbooleanisValid()Determines if this call target has valid machine code that can be entered attached to it.booleanDetermines if this call target has valid machine code attached to it, and that this code was compiled in the last tier.protected voidnotifyDeoptimized(com.oracle.truffle.api.frame.VirtualFrame frame) booleanprepareForCompilation(boolean rootCompilation, int compilationTier, boolean lastTier) When running as part of HotSpot we should pay special attention to CallTargets (CTs) that have been flushed from the code cache because they were cold (According to Code Cache's heuristics).voidsetInstalledCode(jdk.vm.ci.code.InstalledCode code) This method may only be called during compilation, and only by the compiling thread.Methods inherited from class OptimizedCallTarget
accept, asJavaConstant, call, call, callBoundary, callDirect, callIndirect, callInlined, callOSR, canBeInlined, cancelCompilation, compile, computeBlockCompilations, countDirectCallNodes, createFrame, dequeueInlined, doInvoke, engineId, ensureInitialized, equals, getCallAndLoopCount, getCallCount, getCallSiteForSplit, getCompilerOptions, getDebugProperties, getInitializedArgumentsProfile, getInitializedReturnProfile, getInitializedTimestamp, getKnownCallSiteCount, getName, getNonTrivialNodeCount, getOptionValue, getOptionValues, getRootNode, getSingleCallNode, getSourceCallTarget, getSpeculationLog, getSuccessfulCompilationCount, hashCode, highestCompiledTier, invalidate, isInitialized, isSameOrSplit, isSingleCaller, isSourceCallTarget, isSplit, isSubmittedForCompilation, isTrivial, log, maybeWaitForTask, needsCompile, nodeReplaced, onCompilationFailed, onCompilationSuccess, onInvalidate, prepareForAOT, profiledPERoot, resetCompilationProfile, resetNeedsSplit, runtime, scaledThreshold, shouldCompile, toString, waitForCompilation, wasExecuted
-
Constructor Details
-
HotSpotOptimizedCallTarget
public HotSpotOptimizedCallTarget(OptimizedCallTarget sourceCallTarget, com.oracle.truffle.api.nodes.RootNode rootNode) -
HotSpotOptimizedCallTarget
-
-
Method Details
-
setInstalledCode
public void setInstalledCode(jdk.vm.ci.code.InstalledCode code) This method may only be called during compilation, and only by the compiling thread. -
isValid
public boolean isValid()Description copied from class:OptimizedCallTargetDetermines if this call target has valid machine code that can be entered attached to it.- Specified by:
isValidin classOptimizedCallTarget
-
isValidLastTier
public boolean isValidLastTier()Description copied from class:OptimizedCallTargetDetermines if this call target has valid machine code attached to it, and that this code was compiled in the last tier.- Specified by:
isValidLastTierin classOptimizedCallTarget
-
getCodeAddress
public long getCodeAddress()Description copied from class:OptimizedCallTargetGets the address of the machine code for this call target. A non-zero return value denotes the contiguous memory block containing the machine code but does not necessarily represent an entry point for the machine code or even the address of executable instructions. This value is only for informational purposes (e.g., use in a log message).- Specified by:
getCodeAddressin classOptimizedCallTarget
-
getCompilationSpeculationLog
public jdk.vm.ci.meta.SpeculationLog getCompilationSpeculationLog() -
notifyDeoptimized
protected void notifyDeoptimized(com.oracle.truffle.api.frame.VirtualFrame frame) - Overrides:
notifyDeoptimizedin classOptimizedCallTarget
-
prepareForCompilation
public boolean prepareForCompilation(boolean rootCompilation, int compilationTier, boolean lastTier) When running as part of HotSpot we should pay special attention to CallTargets (CTs) that have been flushed from the code cache because they were cold (According to Code Cache's heuristics). Truffle's CallTargets' Profile counter don't decay. For that reason, we need special handling for cold (according to code cache heuristics) CTs that were flushed from the code cache. Otherwise, we can enter a recompilation cycle because Truffle will always see the method as hot (because the profile counters never reset). To handle this case we reset the CT profile whenever its prior compilation was invalidated because it was cold.- Specified by:
prepareForCompilationin interfacecom.oracle.truffle.compiler.TruffleCompilable- Overrides:
prepareForCompilationin classOptimizedCallTarget
-