Class BaseOSRRootNode

java.lang.Object
com.oracle.truffle.api.nodes.Node
com.oracle.truffle.api.nodes.ExecutableNode
com.oracle.truffle.api.nodes.RootNode
com.oracle.truffle.runtime.BaseOSRRootNode
All Implemented Interfaces:
com.oracle.truffle.api.nodes.NodeInterface, Cloneable

public abstract class BaseOSRRootNode extends com.oracle.truffle.api.nodes.RootNode
Base class for on-stack replaced (OSR) root nodes.
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.oracle.truffle.api.nodes.Node

    com.oracle.truffle.api.nodes.Node.Child, com.oracle.truffle.api.nodes.Node.Children
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected com.oracle.truffle.api.nodes.NodeInterface
    Not adopted by the OSRRootNode; belongs to another RootNode.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    BaseOSRRootNode(com.oracle.truffle.api.TruffleLanguage<?> language, com.oracle.truffle.api.frame.FrameDescriptor frameDescriptor, com.oracle.truffle.api.nodes.NodeInterface loopNode)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected boolean
     
    final Object
    execute(com.oracle.truffle.api.frame.VirtualFrame frame)
     
    protected abstract Object
    executeOSR(com.oracle.truffle.api.frame.VirtualFrame frame)
    Entrypoint for OSR root nodes.
    protected com.oracle.truffle.api.frame.VirtualFrame
    getFrame(com.oracle.truffle.api.frame.VirtualFrame frame)
    Returns the effective execution frame for this OSR root.
    protected boolean
    isCaptureFramesForTrace(boolean compiledFrame)
     
    protected final boolean
    prepareForCompilation(boolean rootCompilation, int compilationTier, boolean lastTier)
     

    Methods inherited from class com.oracle.truffle.api.nodes.RootNode

    cloneUninitialized, computeSize, copy, createConstantNode, findAsynchronousFrames, findBytecodeIndex, findInstrumentableCallNode, getCallTarget, getFrameDescriptor, getName, getParentFrameDescriptor, getQualifiedName, isCaptureFramesForTrace, isCaptureFramesForTrace, isCloneUninitializedSupported, isCloningAllowed, isInstrumentable, isInternal, isSameFrame, isTrivial, prepareForAOT, prepareForCall, prepareForInstrumentation, translateStackTraceElement

    Methods inherited from class com.oracle.truffle.api.nodes.ExecutableNode

    getLanguage, getLanguageInfo

    Methods inherited from class com.oracle.truffle.api.nodes.Node

    accept, adoptChildren, atomic, atomic, deepCopy, getChildren, getCost, getDebugProperties, getDescription, getEncapsulatingSourceSection, getLock, getParent, getRootNode, getSourceSection, insert, insert, isAdoptable, isSafelyReplaceableBy, notifyInserted, onReplace, replace, replace, reportPolymorphicSpecialize, reportReplace, toString

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • loopNode

      protected com.oracle.truffle.api.nodes.NodeInterface loopNode
      Not adopted by the OSRRootNode; belongs to another RootNode. OptimizedCallTarget treats OSRRootNodes specially, skipping adoption of child nodes. This loop node instance is also used by the compiler to find the real root node e.g. for the truffle guest safepoint location. See TruffleSafepointInsertionPhase#skipOSRRoot.
  • Constructor Details

    • BaseOSRRootNode

      protected BaseOSRRootNode(com.oracle.truffle.api.TruffleLanguage<?> language, com.oracle.truffle.api.frame.FrameDescriptor frameDescriptor, com.oracle.truffle.api.nodes.NodeInterface loopNode)
  • Method Details

    • execute

      public final Object execute(com.oracle.truffle.api.frame.VirtualFrame frame)
      Specified by:
      execute in class com.oracle.truffle.api.nodes.RootNode
    • prepareForCompilation

      protected final boolean prepareForCompilation(boolean rootCompilation, int compilationTier, boolean lastTier)
      Overrides:
      prepareForCompilation in class com.oracle.truffle.api.nodes.RootNode
    • isCaptureFramesForTrace

      protected boolean isCaptureFramesForTrace(boolean compiledFrame)
      Overrides:
      isCaptureFramesForTrace in class com.oracle.truffle.api.nodes.RootNode
    • countsTowardsStackTraceLimit

      protected boolean countsTowardsStackTraceLimit()
      Overrides:
      countsTowardsStackTraceLimit in class com.oracle.truffle.api.nodes.RootNode
    • getFrame

      protected com.oracle.truffle.api.frame.VirtualFrame getFrame(com.oracle.truffle.api.frame.VirtualFrame frame)
      Returns the effective execution frame for this OSR root.

      The frame passed to execute(VirtualFrame) may differ from the frame used by executeOSR(VirtualFrame) to execute guest code. The returned frame is used for operations that should reflect the effective execution frame, such as attaching lazy exception stack trace information.

    • executeOSR

      protected abstract Object executeOSR(com.oracle.truffle.api.frame.VirtualFrame frame)
      Entrypoint for OSR root nodes.