public class OptimizedCallTarget extends InstalledCode implements com.oracle.truffle.api.RootCallTarget, com.oracle.truffle.api.LoopCountReceiver, com.oracle.truffle.api.ReplaceObserver
Modifier and Type | Class and Description |
---|---|
private static class |
OptimizedCallTarget.NonTrivialNodeCountVisitor |
Modifier and Type | Field and Description |
---|---|
private TruffleStamp |
argumentStamp |
private int |
cachedNonTrivialNodeCount |
private AtomicInteger |
callSitesKnown |
private int |
cloneIndex |
protected CompilationPolicy |
compilationPolicy |
protected CompilationProfile |
compilationProfile |
private boolean |
compiling |
private com.oracle.truffle.api.utilities.ValueProfile |
exceptionProfile |
private TruffleInlining |
inlining |
private com.oracle.truffle.api.utilities.CyclicAssumption |
nodeRewritingAssumption
When this call target is inlined, the inlining
InstalledCode registers this
assumption. |
private Class<?>[] |
profiledArgumentTypes |
private com.oracle.truffle.api.Assumption |
profiledArgumentTypesAssumption |
private Class<?> |
profiledReturnType |
private com.oracle.truffle.api.Assumption |
profiledReturnTypeAssumption |
private com.oracle.truffle.api.nodes.RootNode |
rootNode |
protected GraalTruffleRuntime |
runtime |
private OptimizedCallTarget |
sourceCallTarget |
private SpeculationLog |
speculationLog |
private Map<TruffleStamp,OptimizedCallTarget> |
splitVersions |
private com.oracle.truffle.api.nodes.RootNode |
uninitializedRootNode |
name
Constructor and Description |
---|
OptimizedCallTarget(OptimizedCallTarget sourceCallTarget,
com.oracle.truffle.api.nodes.RootNode rootNode,
GraalTruffleRuntime runtime,
CompilationPolicy compilationPolicy,
SpeculationLog speculationLog) |
Modifier and Type | Method and Description |
---|---|
void |
accept(com.oracle.truffle.api.nodes.NodeVisitor visitor,
boolean includeInlinedNodes) |
static int |
calculateNonTrivialNodes(com.oracle.truffle.api.nodes.Node node) |
Object |
call(Object... args) |
protected Object |
callBoundary(Object[] args) |
Object |
callDirect(Object... args) |
Object |
callInlined(Object... arguments) |
protected Object |
callProxy(com.oracle.truffle.api.frame.VirtualFrame frame) |
Object |
callRoot(Object[] originalArguments) |
private boolean |
cancelInstalledTask(com.oracle.truffle.api.nodes.Node source,
CharSequence reason) |
private Object[] |
castArguments(Object[] originalArguments) |
private static Object |
castArrayFixedLength(Object[] args,
int length) |
private static Class<?> |
classOf(Object arg) |
private static com.oracle.truffle.api.nodes.RootNode |
cloneRootNode(com.oracle.truffle.api.nodes.RootNode root) |
OptimizedCallTarget |
cloneUninitialized() |
void |
compile() |
static com.oracle.truffle.api.frame.VirtualFrame |
createFrame(com.oracle.truffle.api.frame.FrameDescriptor descriptor,
Object[] args) |
void |
decrementKnownCallSites() |
private void |
dequeueInlinedCallSites(TruffleInlining parentDecision) |
protected Object |
doInvoke(Object[] args) |
TruffleStamp |
getArgumentStamp() |
static Method |
getCallDirectMethod() |
static Method |
getCallInlinedMethod() |
List<OptimizedDirectCallNode> |
getCallNodes() |
int |
getCloneIndex() |
CompilationProfile |
getCompilationProfile() |
private com.oracle.truffle.api.CompilerOptions |
getCompilerOptions() |
Map<String,Object> |
getDebugProperties() |
TruffleInlining |
getInlining() |
int |
getKnownCallSiteCount() |
com.oracle.truffle.api.Assumption |
getNodeRewritingAssumption() |
int |
getNonTrivialNodeCount() |
com.oracle.truffle.api.nodes.RootNode |
getRootNode() |
OptimizedCallTarget |
getSourceCallTarget() |
SpeculationLog |
getSpeculationLog() |
Map<TruffleStamp,OptimizedCallTarget> |
getSplitVersions() |
void |
incrementKnownCallSites() |
private void |
initializeProfiledArgumentTypes(Object[] args) |
private void |
interpreterCall() |
void |
invalidate()
Invalidates this installed code such that any subsequent invocation will throw an
InvalidInstalledCodeException . |
protected void |
invalidate(Object source,
CharSequence reason) |
boolean |
isCompiling() |
private static Class<?> |
joinTypes(Class<?> class1,
Class<?> class2) |
void |
log(String message) |
void |
mergeArgumentStamp(TruffleStamp p) |
boolean |
nodeReplaced(com.oracle.truffle.api.nodes.Node oldNode,
com.oracle.truffle.api.nodes.Node newNode,
CharSequence reason) |
Stream<com.oracle.truffle.api.nodes.Node> |
nodeStream(boolean includeInlinedNodes) |
void |
notifyCompilationFailed(Throwable t) |
void |
notifyCompilationFinished(boolean successful) |
private void |
printException(Throwable e) |
(package private) void |
profileArguments(Object[] args) |
(package private) void |
profileReturnType(Object result) |
void |
reportLoopCount(int count) |
void |
setInlining(TruffleInlining inliningDecision) |
String |
toString() |
private void |
updateProfiledArgumentTypes(Object[] args) |
executeVarargs, getAddress, getCode, getCodeSize, getName, getStart, getVersion, isValid, setAddress
protected final GraalTruffleRuntime runtime
private SpeculationLog speculationLog
protected final CompilationProfile compilationProfile
protected final CompilationPolicy compilationPolicy
private final OptimizedCallTarget sourceCallTarget
private final AtomicInteger callSitesKnown
private final com.oracle.truffle.api.utilities.ValueProfile exceptionProfile
private Class<?>[] profiledArgumentTypes
private com.oracle.truffle.api.Assumption profiledArgumentTypesAssumption
private Class<?> profiledReturnType
private com.oracle.truffle.api.Assumption profiledReturnTypeAssumption
private final com.oracle.truffle.api.nodes.RootNode uninitializedRootNode
private final com.oracle.truffle.api.nodes.RootNode rootNode
private final Map<TruffleStamp,OptimizedCallTarget> splitVersions
private TruffleStamp argumentStamp
private TruffleInlining inlining
private int cachedNonTrivialNodeCount
private boolean compiling
private final com.oracle.truffle.api.utilities.CyclicAssumption nodeRewritingAssumption
InstalledCode
registers this
assumption. It gets invalidated when a node rewriting is performed. This ensures that all
compiled methods that have this call target inlined are properly invalidated.private int cloneIndex
public OptimizedCallTarget(OptimizedCallTarget sourceCallTarget, com.oracle.truffle.api.nodes.RootNode rootNode, GraalTruffleRuntime runtime, CompilationPolicy compilationPolicy, SpeculationLog speculationLog)
public final com.oracle.truffle.api.nodes.RootNode getRootNode()
getRootNode
in interface com.oracle.truffle.api.RootCallTarget
public final boolean isCompiling()
private static com.oracle.truffle.api.nodes.RootNode cloneRootNode(com.oracle.truffle.api.nodes.RootNode root)
public com.oracle.truffle.api.Assumption getNodeRewritingAssumption()
public final void mergeArgumentStamp(TruffleStamp p)
public final TruffleStamp getArgumentStamp()
public int getCloneIndex()
public OptimizedCallTarget cloneUninitialized()
public Map<TruffleStamp,OptimizedCallTarget> getSplitVersions()
public SpeculationLog getSpeculationLog()
public Object call(Object... args)
call
in interface com.oracle.truffle.api.CallTarget
public final Object callDirect(Object... args)
public final Object callInlined(Object... arguments)
void profileArguments(Object[] args)
private void initializeProfiledArgumentTypes(Object[] args)
private void updateProfiledArgumentTypes(Object[] args)
protected final Object callBoundary(Object[] args)
void profileReturnType(Object result)
public void invalidate()
InstalledCode
InvalidInstalledCodeException
.invalidate
in class InstalledCode
protected void invalidate(Object source, CharSequence reason)
public TruffleInlining getInlining()
public void setInlining(TruffleInlining inliningDecision)
private boolean cancelInstalledTask(com.oracle.truffle.api.nodes.Node source, CharSequence reason)
private void interpreterCall()
public void compile()
public void notifyCompilationFailed(Throwable t)
private void printException(Throwable e)
public void notifyCompilationFinished(boolean successful)
private void dequeueInlinedCallSites(TruffleInlining parentDecision)
public final int getKnownCallSiteCount()
public final void incrementKnownCallSites()
public final void decrementKnownCallSites()
public final OptimizedCallTarget getSourceCallTarget()
public CompilationProfile getCompilationProfile()
private Object[] castArguments(Object[] originalArguments)
private static Object castArrayFixedLength(Object[] args, int length)
public static com.oracle.truffle.api.frame.VirtualFrame createFrame(com.oracle.truffle.api.frame.FrameDescriptor descriptor, Object[] args)
public List<OptimizedDirectCallNode> getCallNodes()
public void reportLoopCount(int count)
reportLoopCount
in interface com.oracle.truffle.api.LoopCountReceiver
public boolean nodeReplaced(com.oracle.truffle.api.nodes.Node oldNode, com.oracle.truffle.api.nodes.Node newNode, CharSequence reason)
nodeReplaced
in interface com.oracle.truffle.api.ReplaceObserver
public void accept(com.oracle.truffle.api.nodes.NodeVisitor visitor, boolean includeInlinedNodes)
public Stream<com.oracle.truffle.api.nodes.Node> nodeStream(boolean includeInlinedNodes)
public final int getNonTrivialNodeCount()
public static int calculateNonTrivialNodes(com.oracle.truffle.api.nodes.Node node)
public Map<String,Object> getDebugProperties()
public static Method getCallDirectMethod()
public static Method getCallInlinedMethod()
private com.oracle.truffle.api.CompilerOptions getCompilerOptions()