Class DynamicObject.SetDynamicTypeNode

java.lang.Object
com.oracle.truffle.api.nodes.Node
com.oracle.truffle.api.object.DynamicObject.SetDynamicTypeNode
All Implemented Interfaces:
NodeInterface, Cloneable
Enclosing class:
DynamicObject

public abstract static class DynamicObject.SetDynamicTypeNode extends Node
Sets the language-specific dynamic type identifier.
Since:
25.1
See Also:
  • Method Details

    • execute

      public abstract boolean execute(DynamicObject receiver, Object type)
      Sets the object's dynamic type identifier. What this type represents is completely up to the language. For example, it could be a guest-language class. The type object is strongly referenced from the shape. It should ideally be a singleton or light-weight object without any references to guest language objects in order to keep the memory footprint low and prevent potential memory leaks from holding onto the Shape in inline caches. The Shape transition itself is weak, so the previous shapes will not hold strongly on the type object. Type objects are always compared by object identity, never equals.
      Parameters:
      type - a non-null type identifier defined by the guest language.
      Returns:
      true if the type (and the object's shape) changed
      See Also:
    • create

      public static DynamicObject.SetDynamicTypeNode create()
      Since:
      25.1
    • getUncached

      public static DynamicObject.SetDynamicTypeNode getUncached()
      Since:
      25.1