Class ConfineInstr
java.lang.Object
org.ek9lang.compiler.ir.instructions.IRInstr
org.ek9lang.compiler.ir.instructions.ConfineInstr
- All Implemented Interfaces:
INode
CONFINE value, site and CONFINE value, with, holder: the object the instruction before it has just
made is held by nothing outside this operation's frame - unconditionally, or except for ONE named object it is about
to be kept into - so the thread that made it owns it for life although its TYPE is not [confined]
(EK9_NATIVE_CYCLE_COLLECTOR_DESIGN.md §13.11, N-V; NV_PER_SITE_CONFINEMENT.md §2-§3 - the mirror of
PublishInstr: a PUBLISH goes immediately BEFORE the instruction that shares a value, a
CONFINE immediately AFTER the allocation that makes one). Placed only by IR_OPTIMISATION
(ConfinePlacement, under the confine pass switch) from the per-value escape record IR_ANALYSIS
stamped (ConfinedSites, THE rule).
ConfineInstr.Reason.SITE- the unconditional stamp (V1): a site whose record, with what it may reach through a holder's other contents, stays NONE or LOCAL, with no capture holder, of a type that is not already confined and may lie on a cycle.ConfineInstr.Reason.WITH- the conditional stamp (V3): a site whose record reachesthisor a parameter through EXACTLY ONE holder outside the frame - the object it is stored into directly as a field, or the core container whose extern member keeps it into the container's own structure - named as theholder, an IR name already defined when the stamp runs (thisor an earlier temp). The object is confined exactly when that holder is, and the holder's stamp decides at run time (ek9_cycle_stamp_like_holder).
ek9_cycle_confine, V2) so its thread may buffer, walk and
free it while other threads run. V-N (ConfineVerifier) checks each one is exactly where the rule says and
that none is missing: a stray stamp is the unsafe direction (another thread's free against this thread's buffer), a
missing one a leak the ledger counts.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhy a value is confined - which proof allows it. -
Constructor Summary
ConstructorsConstructorDescriptionConfineInstr(String value, ConfineInstr.Reason reason) A site confine: the value is stamped unconditionally.ConfineInstr(String value, ConfineInstr.Reason reason, String holder) A conditional confine: the value is stamped whenholderis. -
Method Summary
Modifier and TypeMethodDescriptionForConfineInstr.Reason.WITH: the variable (this, or an earlier temp) whose object the value is kept into; the value is confined only when it is.getValue()The variable whose fresh object is confined to this thread.Methods inherited from class IRInstr
accept, addOperand, addOperands, equals, getDebugInfo, getEscapeMetaData, getOpcode, getOperands, getResult, hasEscapeMetaData, hashCode, hasResult, isControlFlow, isLabel, isMemoryManagement, isMethodCall, setEscapeMetaData, toString
-
Constructor Details
-
ConfineInstr
A site confine: the value is stamped unconditionally. -
ConfineInstr
A conditional confine: the value is stamped whenholderis.
-
-
Method Details
-
getValue
The variable whose fresh object is confined to this thread. -
getReason
-
getHolder
ForConfineInstr.Reason.WITH: the variable (this, or an earlier temp) whose object the value is kept into; the value is confined only when it is. Null forConfineInstr.Reason.SITE.
-