Class ConfineVerifier
java.lang.Object
org.ek9lang.compiler.phase9.ConfineVerifier
- All Implemented Interfaces:
Function<IRConstruct, List<String>>
V-N (N-V V1 and V3; NV_PER_SITE_CONFINEMENT.md ยง3.3, the V-P discipline), two checks over every operation:
- exact: each instruction is immediately followed by exactly the
CONFINEsConfinedSites.decide(IRConstruct, OperationInstr)says, in order - reason and holder included - and everyCONFINEis one of those. It catches a pass that drops, moves or invents one - a stray stamp lets another thread free a candidate of this thread's buffer, the unsafe direction; a missing one is a leak; - audit, by exact NAME over the operation and independent of the rule: for every
CONFINE v- (a) the instruction before it is an allocation site (IsAllocationSite) whose result isv(the stamp precedes any use); (b)vis never published, thrown, returned, stored into a static, assigned to a CALLER slot, handed to runtime threads (HandsValuesToRuntimeThreads) or given to a capture constructor; (c) every reference edge that storesvinto a holder (ReferenceEdges), and every assignment ofvto a property ofthisor a field, has a holder that is a value of this operation - never a static, neverthisor a property of it, never a CALLER slot, never a value that is itself captured or handed to threads - with a holder named by aLOAD,LOAD_FIELD,CASTorSANITIZEtemp resolved to its base (review F6 (ii): aLOAD_FIELD this, ftemp ISthis); forCONFINE v, with, hthe ONE allowed exception ishitself: every such holder's base must beh's base, and besides (d)histhisor defined before the site in the same or an enclosing list, (e)h's base does not itself escape, (f) the operation is not a constructor,_i_initor_c_init. Aliases are the record's business (the exact check); the audit is the belt that catches a rule error on the exact name, as V-P's audit does - it cannot see an alias-class error, which is what the fuse and the census's holder invariants are for.
ConfinePlacement and PublishPlacement, beside V-P, V-S and V-I; a finding is a compiler
defect.-
Constructor Summary
ConstructorsConstructorDescriptionConfineVerifier(ConfinedSites confinedSites, PublishedValues publishedValues) -
Method Summary
-
Constructor Details
-
ConfineVerifier
- Parameters:
confinedSites- THE rule, the same one the placement was given.publishedValues- THE program's publish rule, for its callee resolution (CalleeOfCall) - the audit's capture-constructor test and its reference edges read the callee the same way V-P's audit does.
-
-
Method Details
-
apply
- Specified by:
applyin interfaceFunction<IRConstruct, List<String>>
-