Class InlineSupport.ReferenceField<T>

java.lang.Object
com.oracle.truffle.api.dsl.InlineSupport.InlinableField
com.oracle.truffle.api.dsl.InlineSupport.ReferenceField<T>
Enclosing class:
InlineSupport

public static final class InlineSupport.ReferenceField<T> extends InlineSupport.InlinableField
Represents a field for references in inlined nodes.
Since:
23.0
  • Method Details

    • createParentAccessor

      @Deprecated public InlineSupport.ReferenceField<T> createParentAccessor(Class<? extends Node> parentClass)
      Deprecated.
      in 23.1 - no longer needed
      This method creates a parent accessor field. A parent accessor allows access to a field through a parent pointer. The given class must exactly match the given receiver. This method is intended to be used by the DSL-generated code.
      Since:
      23.0
    • get

      public T get(Node node)
      This method returns the value of the target field given a target node. The node parameter must match the class the field was created with. If the type is not compatible, an ClassCastException is thrown. If null is provided, then a NullPointerException is thrown.
      Since:
      23.0
    • set

      public void set(Node node, T value)
      This method sets the value of the target field giving the a target node. The node parameter must match the class the field was created with. If the type is not compatible, an ClassCastException is thrown. If null is provided, then a NullPointerException is thrown.
      Since:
      23.0
    • getVolatile

      public T getVolatile(Node node)
      This method returns the value of the target field given a target node using volatile semantics. The node parameter must match the class the field was created with. If the type is not compatible, an ClassCastException is thrown. If null is provided, then a NullPointerException is thrown.
      Since:
      23.0
    • compareAndSet

      public boolean compareAndSet(Node node, T expect, T update)
      This method sets the value of the target field giving the a target node and expected value using compare and set semantics. The node parameter must match the class the field was created with. If the type is not compatible, an ClassCastException is thrown. If null is provided, then a NullPointerException is thrown.
      Since:
      23.0
    • create

      public static <T> InlineSupport.ReferenceField<T> create(MethodHandles.Lookup declaringLookup, String field, Class<T> valueClass)
      This method creates a new field given a lookup class, field name and value class. The lookup class requires access to the field and must be directly accessible. If the field is not found or the field type is not compatible, then an IllegalArgumentException is thrown. The given field must not be final. This method is intended to be used by DSL-generated code only.
      Since:
      23.0