Class OwnershipVerifier
java.lang.Object
org.ek9lang.compiler.phase9.OwnershipVerifier
THE local rules of the ownership form (EK9_IR_OWNERSHIP_MODEL.md §11.2; stage-1 design §7) - the ones that need
only the structured lists, not a per-path analysis:
- V-C only an OWNED value is consumed, not twice in one straight list, and a value MOVED on a path (by
DROPor a[consume]assignment) is not used after it on that path - its count now belongs to where it went, which may release it (Swift's use-after-move rule); - V-D a
CASTforwards its operand's kind, and consumes an OWNED operand; - V-E the arms of a chain hand back values of one kind;
- V-F
DROP_AT_EXITnames a scope open in the current activation (the A11 rule); - V-G a slot's owner is open (or the CALLER or OBJECT) where the slot is first filled - its
declaration, or its first
[init]assignment when it is declared before its owner is entered (Contract 3: a try's resources and its region's first failure) - a slot is declared once per activation, and a slot is never itself dropped; - V-H a consumed argument is consumed by its call; an unmanaged result carries no count;
- V-M the IR is in the ownership form ONLY:
RETAIN,RELEASE,RELEASE_FIELDandSCOPE_REGISTERareOwnershipLowering's output, never phase 7's, andREFERENCE/TYPED_REFERENCEdeclares only a compiler temporary that holds no count of its own - every named variable is aSLOT_DECLAREwith its owner (stage 3).
The rules see only what the ownership form states: a value's kind is ValueKind.madeBy(IRInstr) the instruction that
made it (a CAST forwards its operand's), and a value no rule names is skipped. The per-path rules (V-A, V-B, V-I,
V-J) wait for stage 4. Findings are structural.
-
Method Summary
Modifier and TypeMethodDescriptionThe problems in one operation body; empty when it keeps every local rule.check(IRConstruct construct) THE check of a construct in the ownership form (IR_ANALYSIS, and every IR fixture): each operation's problems as"operation: problem"; empty when every operation keeps every local rule.
-
Method Details
-
check
THE check of a construct in the ownership form (IR_ANALYSIS, and every IR fixture): each operation's problems as"operation: problem"; empty when every operation keeps every local rule. The lowered form is checked byRetainReleaseBalanceVerifier(V-L), never by this. -
check
-