Class Location

java.lang.Object
com.oracle.truffle.api.object.Location

public abstract class Location extends Object
Property location. Planned to be deprecated.
Since:
0.8 or earlier
See Also:
  • Constructor Details

    • Location

      protected Location()
      Constructor for subclasses.
      Since:
      0.8 or earlier
  • Method Details

    • incompatibleLocation

      @Deprecated(since="22.2") protected static IncompatibleLocationException incompatibleLocation() throws IncompatibleLocationException
      Deprecated.
      Throws:
      IncompatibleLocationException
      Since:
      0.8 or earlier
    • finalLocation

      @Deprecated(since="22.2") protected static FinalLocationException finalLocation() throws FinalLocationException
      Deprecated.
      Throws:
      FinalLocationException
      Since:
      0.8 or earlier
    • get

      @Deprecated(since="22.2") public final Object get(DynamicObject store, Shape shape)
      Deprecated.
      Get object value as object at this location in store.
      Parameters:
      shape - the current shape of the object, which must contain this location
      Since:
      0.8 or earlier
    • get

      @Deprecated(since="22.2") public Object get(DynamicObject store, boolean condition)
      Deprecated.
      Get object value as object at this location in store. For internal use only and subject to change, use get(DynamicObject, Shape) instead.
      Parameters:
      store - storage object
      condition - the result of a shape check or false
      Since:
      0.8 or earlier
      See Also:
    • get

      @Deprecated(since="22.2") public final Object get(DynamicObject store)
      Deprecated.
      Get object value as object at this location in store.
      Since:
      0.8 or earlier
    • getInt

      protected int getInt(DynamicObject store, boolean guard) throws UnexpectedResultException
      Gets this location's value as int.
      Parameters:
      store - storage object
      guard - the result of a shape check or false
      Throws:
      UnexpectedResultException - if the location does not contain an int value.
      Since:
      22.2
    • getLong

      protected long getLong(DynamicObject store, boolean guard) throws UnexpectedResultException
      Gets this location's value as long.
      Parameters:
      store - storage object
      guard - the result of a shape check or false
      Throws:
      UnexpectedResultException - if the location does not contain a long value.
      Since:
      22.2
    • getDouble

      protected double getDouble(DynamicObject store, boolean guard) throws UnexpectedResultException
      Gets this location's value as double.
      Parameters:
      store - storage object
      guard - the result of a shape check or false
      Throws:
      UnexpectedResultException - if the location does not contain a double value.
      Since:
      22.2
    • set

      @Deprecated(since="22.2") public void set(DynamicObject store, Object value, Shape shape) throws IncompatibleLocationException, FinalLocationException
      Deprecated.
      Set object value at this location in store.
      Parameters:
      store - storage object
      value - the value to set
      shape - the current shape of the storage object
      Throws:
      IncompatibleLocationException - for storage type invalidations
      FinalLocationException - for effectively final fields
      Since:
      0.8 or earlier
    • set

      @Deprecated(since="22.2") public void set(DynamicObject store, Object value, Shape oldShape, Shape newShape) throws IncompatibleLocationException
      Deprecated.
      Set object value at this location in store and update shape.
      Parameters:
      oldShape - the shape before the transition
      newShape - new shape after the transition
      Throws:
      IncompatibleLocationException - if value is of non-assignable type
      Since:
      0.8 or earlier
    • canSet

      @Deprecated(since="22.2") public boolean canSet(Object value)
      Deprecated.
      Equivalent to canStore(Object).
      Returns true if the location can be set to the value.
      Parameters:
      value - the value in question
      Since:
      0.8 or earlier
    • canStore

      public boolean canStore(Object value)
      Returns true if the location is compatible with the type of the value.
      Parameters:
      value - the value in question
      Since:
      0.8 or earlier
    • isFinal

      public boolean isFinal()
      Returns true if this is a final location, i.e. readonly once set.
      Since:
      0.8 or earlier
    • isConstant

      public boolean isConstant()
      Returns true if this is a constant value location.
      Since:
      0.8 or earlier
    • hashCode

      public abstract int hashCode()
      Abstract to force overriding.
      Overrides:
      hashCode in class Object
      Since:
      0.8 or earlier
    • equals

      public abstract boolean equals(Object obj)
      Abstract to force overriding.
      Overrides:
      equals in class Object
      Since:
      0.8 or earlier
    • isDeclared

      @Deprecated(since="22.2") public boolean isDeclared()
      Deprecated.
      No longer needed. Declared locations can only be created with deprecated APIs.
      Returns true if this is a declared value location.
      Since:
      0.18
    • isValue

      public boolean isValue()
      Returns true if this is a value location.
      Since:
      0.18
      See Also:
    • isAssumedFinal

      public boolean isAssumedFinal()
      Returns true if this location is assumed to be final.
      Since:
      0.18
      See Also:
    • getFinalAssumption

      public Assumption getFinalAssumption()
      Returns the assumption that this location is final.
      Since:
      0.18
      See Also:
    • isPrimitive

      public boolean isPrimitive()
      Returns true if this location can only store primitive types and cannot contain any object references.
      Since:
      22.2
    • getConstantValue

      public Object getConstantValue()
      If this is a constant location, returns the constant value bound to this location. Otherwise, returns null.
      Since:
      22.2