Record Class EscapeMetaDataDetails

java.lang.Object
java.lang.Record
org.ek9lang.compiler.ir.data.EscapeMetaDataDetails

public record EscapeMetaDataDetails(EscapeMetaDataDetails.EscapeLevel escapeLevel, EscapeMetaDataDetails.LifetimeScope lifetimeScope, Set<String> optimizationHints) extends Record
Escape analysis metadata for IR optimisation phase. Indicates whether values can escape their current scope and enables backend optimizations like stack allocation instead of reference counting.
  • Constructor Details

    • EscapeMetaDataDetails

      public EscapeMetaDataDetails(EscapeMetaDataDetails.EscapeLevel escapeLevel, EscapeMetaDataDetails.LifetimeScope lifetimeScope, Set<String> optimizationHints)
      Creates an instance of a EscapeMetaDataDetails record class.
      Parameters:
      escapeLevel - the value for the escapeLevel record component
      lifetimeScope - the value for the lifetimeScope record component
      optimizationHints - the value for the optimizationHints record component
  • Method Details

    • noEscape

      public static EscapeMetaDataDetails noEscape(EscapeMetaDataDetails.LifetimeScope lifetimeScope)
      Creates metadata for values that don't escape their scope.
    • escapeParameter

      public static EscapeMetaDataDetails escapeParameter(EscapeMetaDataDetails.LifetimeScope lifetimeScope)
      Creates metadata for values that escape to parameters.
    • escapeGlobal

      public static EscapeMetaDataDetails escapeGlobal(EscapeMetaDataDetails.LifetimeScope lifetimeScope)
      Creates metadata for values that escape globally.
    • toString

      @Nonnull public String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • escapeLevel

      public EscapeMetaDataDetails.EscapeLevel escapeLevel()
      Returns the value of the escapeLevel record component.
      Returns:
      the value of the escapeLevel record component
    • lifetimeScope

      public EscapeMetaDataDetails.LifetimeScope lifetimeScope()
      Returns the value of the lifetimeScope record component.
      Returns:
      the value of the lifetimeScope record component
    • optimizationHints

      public Set<String> optimizationHints()
      Returns the value of the optimizationHints record component.
      Returns:
      the value of the optimizationHints record component