Class ConfinePlacement
java.lang.Object
org.ek9lang.compiler.phase9.ConfinePlacement
- All Implemented Interfaces:
Consumer<Collection<IRConstruct>>
THE placement of
CONFINE (N-V V1 and V3; NV_PER_SITE_CONFINEMENT.md ยง3.3): an IR_OPTIMISATION pass after
SafePointPlacement and CancelPointPlacement and BEFORE PublishPlacement, over the ownership
form, before the lowering. Over the whole program it puts a CONFINE v, site immediately after each
allocation site whose object the record proves this thread's own, and a CONFINE v, with, h after each
whose one holder outside the frame the IR can name (ConfinedSites.decide(IRConstruct, OperationInstr) decides which, once per
operation). ConfineVerifier (V-N) checks the result. It rewrites no ownership: a confined value is still
counted, owned and dropped as before, and a garbage-collected back end emits nothing for it.
Beside the publish pass, in either order: a PUBLISH goes immediately BEFORE the instruction that shares a
value and a CONFINE immediately AFTER the one that makes one, each inserted beside its own anchor by the
per-instruction rewrite, so a site directly followed by a publishing instruction comes out
site, CONFINE, PUBLISH, instruction whichever pass runs first - V-N sees the CONFINE right after
its site, V-P sees the PUBLISH right before its instruction (ConfinePlacementTest pins the shape).
Under the confine pass switch (PassSwitches.CONFINE) with V-N.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(Collection<IRConstruct> constructs) intplaced()How manyCONFINEs this placement has put in, over everything it was given - both forms.The same, by the allocated type's fully qualified name (the census the-vline and the ledger quote).intHow many of those are the conditional form,CONFINE v, with, h.
-
Constructor Details
-
ConfinePlacement
-
-
Method Details
-
accept
- Specified by:
acceptin interfaceConsumer<Collection<IRConstruct>>
-
placed
public int placed()How manyCONFINEs this placement has put in, over everything it was given - both forms. -
placedWith
public int placedWith()How many of those are the conditional form,CONFINE v, with, h. -
placedByType
-