Record Class InputClassProbeArg

java.lang.Object
java.lang.Record
org.ek9lang.compiler.ir.data.InputClassProbeArg
Record Components:
paramIndex - zero-based position in the callable's flattened leaf-dimension list (the receiver, when present, is index 0 and the arguments follow)
variableName - the IR local variable name the backend loads onto the stack (ignored for the receiver, which loads this)
typeName - the fully-qualified declared type of the dimension (diagnostic / metadata)
receiver - true iff this is the receiver dimension — the backend loads this (ALOAD 0) rather than a named parameter local
enumeration - true iff this dimension's classes are enumeration members, so the runtime records the member name rather than bucketing the value

public record InputClassProbeArg(int paramIndex, String variableName, String typeName, boolean receiver, boolean enumeration) extends Record
One dimension captured by an INPUT_CLASS_PROBE (design EK9_INPUT_VARIATION_METRIC_DESIGN.md §5) — either a declared argument or the receiver as the implicit p0 (§4.5). Names the live local the backend loads (a parameter variable, or this for the receiver) so the runtime classifier can place the actual value into a ValueClassId leaf cell during the -t run.

Records need nothing special here. A record decomposes into one dimension per field leaf (§4.5), but that decomposition is expressed as ordinary LOAD_FIELD instructions emitted before the probe — so a record leaf arrives as just another named local, indistinguishable to the backend from a scalar parameter.

Enumerations need one bit. An enum's value-classes are its members, and the member name is only reachable at runtime via _string() — but a generated enum is a plain class implementing Any with no runtime marker, so the classifier cannot tell one from any other user type. (It must not simply call _string() on everything unrecognised: for an opaque class that returns arbitrary text, and every distinct string would become a new class, letting the numerator exceed that type's floor of 2.) The genus is compile-time knowledge, so enumeration carries it to the backend, which selects the enum-aware runtime entry point. That is a method choice, not logic — no backend walks anything.

  • Constructor Details

    • InputClassProbeArg

      public InputClassProbeArg(int paramIndex, String variableName, String typeName, boolean receiver, boolean enumeration)
      Creates an instance of a InputClassProbeArg record class.
      Parameters:
      paramIndex - the value for the paramIndex record component
      variableName - the value for the variableName record component
      typeName - the value for the typeName record component
      receiver - the value for the receiver record component
      enumeration - the value for the enumeration record component
  • Method Details

    • argument

      public static InputClassProbeArg argument(int paramIndex, String variableName, String typeName, boolean enumeration)
      A declared-argument dimension — the backend loads the named parameter local.
    • receiver

      public static InputClassProbeArg receiver(int paramIndex, String typeName, boolean enumeration)
      The receiver dimension (p0, §4.5) — the backend loads this.
    • toString

      public final 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • paramIndex

      public int paramIndex()
      Returns the value of the paramIndex record component.
      Returns:
      the value of the paramIndex record component
    • variableName

      public String variableName()
      Returns the value of the variableName record component.
      Returns:
      the value of the variableName record component
    • typeName

      public String typeName()
      Returns the value of the typeName record component.
      Returns:
      the value of the typeName record component
    • receiver

      public boolean receiver()
      Returns the value of the receiver record component.
      Returns:
      the value of the receiver record component
    • enumeration

      public boolean enumeration()
      Returns the value of the enumeration record component.
      Returns:
      the value of the enumeration record component