Record Class CallConventions
java.lang.Object
java.lang.Record
org.ek9lang.compiler.ir.data.CallConventions
- Record Components:
ownedArguments- zero-based positions of the arguments the callee consumesunmanagedResult- true when the result carries no count (anEk9Asynchandle)mayThrow- false only when the call is proven never to throw
public record CallConventions(Set<Integer> ownedArguments, boolean unmanagedResult, boolean mayThrow)
extends Record
The ownership facts of one call (EK9_IR_OWNERSHIP_MODEL.md ยง5): which arguments the callee CONSUMES (every other
argument is GUARANTEED - borrowed for the call), whether the result is OWNED (+1, the caller must end it) or
UNMANAGED (no count at all), and whether the call may throw.
DEFAULT is exactly today's convention - arguments borrowed, result owned, may throw - so a call that says
nothing means what every call has always meant. Only a difference from the default is rendered in the IR text.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CallConventionsArguments borrowed, result owned, may throw - today's meaning of every call. -
Constructor Summary
ConstructorsConstructorDescriptionCallConventions(Set<Integer> ownedArguments, boolean unmanagedResult, boolean mayThrow) Creates an instance of aCallConventionsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionclauses()booleanconsumesArgument(int position) True when the callee consumes the argument atposition.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanmayThrow()Returns the value of themayThrowrecord component.Returns the value of theownedArgumentsrecord component.final StringtoString()Returns a string representation of this record class.booleanReturns the value of theunmanagedResultrecord component.The same conventions, proven never to throw.withOwnedArgument(int position) The same conventions with the argument atpositionconsumed by the callee.The same conventions with an UNMANAGED result.
-
Field Details
-
DEFAULT
Arguments borrowed, result owned, may throw - today's meaning of every call.
-
-
Constructor Details
-
CallConventions
Creates an instance of aCallConventionsrecord class.- Parameters:
ownedArguments- the value for theownedArgumentsrecord componentunmanagedResult- the value for theunmanagedResultrecord componentmayThrow- the value for themayThrowrecord component
-
-
Method Details
-
withUnmanagedResult
The same conventions with an UNMANAGED result. -
withOwnedArgument
The same conventions with the argument atpositionconsumed by the callee. -
withNoThrow
The same conventions, proven never to throw. -
consumesArgument
public boolean consumesArgument(int position) True when the callee consumes the argument atposition. -
clauses
-
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. -
ownedArguments
Returns the value of theownedArgumentsrecord component.- Returns:
- the value of the
ownedArgumentsrecord component
-
unmanagedResult
public boolean unmanagedResult()Returns the value of theunmanagedResultrecord component.- Returns:
- the value of the
unmanagedResultrecord component
-
mayThrow
-