Enum Class ValueKind
- All Implemented Interfaces:
Serializable, Comparable<ValueKind>, Constable
A value's ownership kind (EK9_IR_OWNERSHIP_MODEL.md ยง3), and THE rule for the kind of the value an instruction
makes. The generator asks it before it states a value's owner (
VariableMemoryManagement: a value made here
is owned by the scope, anything else borrowed for it) and the verifier asks it before it checks that statement
(OwnershipVerifier) - one rule, so the two can never disagree about what arrived owned.-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription+0: valid while its source is - a load of a variable, field, static or constant, a function instance.No count at all: an unmanaged call result, a primitive or Void result, a constructor delegation's.+1: the activation that holds it consumes it exactly once on every path - a call result, a literal, a collection literal, a string interpolation, a static's value taken out of it, the exception an assert-throws or assert-panic expression caught. -
Method Summary
Modifier and TypeMethodDescriptionstatic ValueKindThe kind of the valueinstructionmakes; null when it makes none, or states none (aSTORE, and aCAST, which forwards its operand's kind - V-D).static booleanreturnsOwned(CallInstr call) Does this call hand back an owned (+1) result - whether or not the IR names it? A call that does and names no result discards a count: the native back end releases nothing it was not told to.static ValueKindReturns the enum constant of this class with the specified name.static ValueKind[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
OWNED
+1: the activation that holds it consumes it exactly once on every path - a call result, a literal, a collection literal, a string interpolation, a static's value taken out of it, the exception an assert-throws or assert-panic expression caught. -
BORROWED
+0: valid while its source is - a load of a variable, field, static or constant, a function instance. -
NONE
No count at all: an unmanaged call result, a primitive or Void result, a constructor delegation's.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
returnsOwned
Does this call hand back an owned (+1) result - whether or not the IR names it? A call that does and names no result discards a count: the native back end releases nothing it was not told to. -
madeBy
-