Class PropertyNode

All Implemented Interfaces:
com.oracle.truffle.api.instrumentation.InstrumentableNode, com.oracle.truffle.api.nodes.NodeInterface, ReadNode, Cloneable

public class PropertyNode extends JSTargetableNode implements ReadNode
  • Constructor Details

    • PropertyNode

      protected PropertyNode(JSContext context, JavaScriptNode target, Object propertyKey, boolean getOwnProperty, boolean method)
  • Method Details

    • hasTag

      public boolean hasTag(Class<? extends com.oracle.truffle.api.instrumentation.Tag> tag)
      Specified by:
      hasTag in interface com.oracle.truffle.api.instrumentation.InstrumentableNode
      Overrides:
      hasTag in class JavaScriptNode
    • getNodeObject

      public Object getNodeObject()
      Specified by:
      getNodeObject in interface com.oracle.truffle.api.instrumentation.InstrumentableNode
    • materializeInstrumentableNodes

      public com.oracle.truffle.api.instrumentation.InstrumentableNode materializeInstrumentableNodes(Set<Class<? extends com.oracle.truffle.api.instrumentation.Tag>> materializedTags)
      Specified by:
      materializeInstrumentableNodes in interface com.oracle.truffle.api.instrumentation.InstrumentableNode
    • createProperty

      public static PropertyNode createProperty(JSContext ctx, JavaScriptNode target, Object propertyKey, boolean method)
    • createProperty

      public static PropertyNode createProperty(JSContext ctx, JavaScriptNode target, Object propertyKey)
    • createGetHidden

      public static PropertyNode createGetHidden(JSContext ctx, JavaScriptNode target, com.oracle.truffle.api.object.HiddenKey hiddenKey)
    • execute

      public Object execute(com.oracle.truffle.api.frame.VirtualFrame frame)
      Description copied from class: JavaScriptNode
      Executes this node using the specified context and frame and returns the result value.
      Specified by:
      execute in class JavaScriptNode
      Parameters:
      frame - the frame of the currently executing guest language method
      Returns:
      the value of the execution
    • executeWithTarget

      public Object executeWithTarget(com.oracle.truffle.api.frame.VirtualFrame frame, Object targetValue)
      Specified by:
      executeWithTarget in class JSTargetableNode
    • executeWithTarget

      public Object executeWithTarget(Object targetValue)
    • executeWithTarget

      public Object executeWithTarget(Object targetValue, Object receiverValue)
    • executeInt

      public int executeInt(com.oracle.truffle.api.frame.VirtualFrame frame) throws com.oracle.truffle.api.nodes.UnexpectedResultException
      Description copied from class: JavaScriptNode
      Like JavaScriptNode.execute(VirtualFrame) except that it tries to convert the result value to an int. A node can override this method if it has a better way to producing a value of type int.
      Overrides:
      executeInt in class JavaScriptNode
      Parameters:
      frame - the frame of the currently executing guest language method
      Returns:
      the value of the execution as an int
      Throws:
      com.oracle.truffle.api.nodes.UnexpectedResultException - if a loss-free conversion of the result to int is not possible
    • executeInt

      public int executeInt(Object targetValue, Object receiverValue) throws com.oracle.truffle.api.nodes.UnexpectedResultException
      Throws:
      com.oracle.truffle.api.nodes.UnexpectedResultException
    • executeDouble

      public double executeDouble(com.oracle.truffle.api.frame.VirtualFrame frame) throws com.oracle.truffle.api.nodes.UnexpectedResultException
      Description copied from class: JavaScriptNode
      Like JavaScriptNode.execute(VirtualFrame) except that it tries to convert the result value to a double. A node can override this method if it has a better way to producing a value of type double.
      Overrides:
      executeDouble in class JavaScriptNode
      Parameters:
      frame - the frame of the currently executing guest language method
      Returns:
      the value of the execution as a double
      Throws:
      com.oracle.truffle.api.nodes.UnexpectedResultException - if a loss-free conversion of the result to double is not possible
    • executeDouble

      public double executeDouble(Object targetValue, Object receiverValue) throws com.oracle.truffle.api.nodes.UnexpectedResultException
      Throws:
      com.oracle.truffle.api.nodes.UnexpectedResultException
    • evaluateTarget

      public final Object evaluateTarget(com.oracle.truffle.api.frame.VirtualFrame frame)
      Overrides:
      evaluateTarget in class JSTargetableNode
    • getTarget

      public JavaScriptNode getTarget()
      Overrides:
      getTarget in class JSTargetableNode
    • getPropertyKey

      public Object getPropertyKey()
    • toString

      public String toString()
      Overrides:
      toString in class JavaScriptNode
    • copyUninitialized

      protected JavaScriptNode copyUninitialized(Set<Class<? extends com.oracle.truffle.api.instrumentation.Tag>> materializedTags)
      Overrides:
      copyUninitialized in class JavaScriptNode
    • expressionToString

      public String expressionToString()
      Overrides:
      expressionToString in class JavaScriptNode
    • isOwnProperty

      public final boolean isOwnProperty()
    • isMethod

      public final boolean isMethod()
    • getContext

      public JSContext getContext()