Record Class 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 loadsthis)typeName- the fully-qualified declared type of the dimension (diagnostic / metadata)receiver-trueiff this is the receiver dimension — the backend loadsthis(ALOAD 0) rather than a named parameter localenumeration-trueiff this dimension's classes are enumeration members, so the runtime records the member name rather than bucketing the value
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 Summary
ConstructorsConstructorDescriptionInputClassProbeArg(int paramIndex, String variableName, String typeName, boolean receiver, boolean enumeration) Creates an instance of aInputClassProbeArgrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic InputClassProbeArgA declared-argument dimension — the backend loads the named parameter local.booleanReturns the value of theenumerationrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of theparamIndexrecord component.booleanreceiver()Returns the value of thereceiverrecord component.static InputClassProbeArgThe receiver dimension (p0, §4.5) — the backend loadsthis.final StringtoString()Returns a string representation of this record class.typeName()Returns the value of thetypeNamerecord component.Returns the value of thevariableNamerecord component.
-
Constructor Details
-
InputClassProbeArg
public InputClassProbeArg(int paramIndex, String variableName, String typeName, boolean receiver, boolean enumeration) Creates an instance of aInputClassProbeArgrecord class.- Parameters:
paramIndex- the value for theparamIndexrecord componentvariableName- the value for thevariableNamerecord componenttypeName- the value for thetypeNamerecord componentreceiver- the value for thereceiverrecord componentenumeration- the value for theenumerationrecord 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
The receiver dimension (p0, §4.5) — the backend loadsthis. -
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
paramIndex
public int paramIndex()Returns the value of theparamIndexrecord component.- Returns:
- the value of the
paramIndexrecord component
-
variableName
Returns the value of thevariableNamerecord component.- Returns:
- the value of the
variableNamerecord component
-
typeName
-
receiver
-
enumeration
public boolean enumeration()Returns the value of theenumerationrecord component.- Returns:
- the value of the
enumerationrecord component
-