Class PublishInstr
java.lang.Object
org.ek9lang.compiler.ir.instructions.IRInstr
org.ek9lang.compiler.ir.instructions.PublishInstr
- All Implemented Interfaces:
INode
PUBLISH value, reason[, holder]: from here on the value, and everything it reaches, is shared with runtime
threads for as long as the program runs (EK9_NATIVE_CYCLE_COLLECTOR_DESIGN.md ยง13.11, S2 and S2b; re-investigation
F1). Placed only by IR_OPTIMISATION (PublishPlacement), immediately before the instruction that makes the
value long-lived:
PublishInstr.Reason.REGISTRY- an application's_preparestoring a registration into its_Applicationstatic: every handler and service operation reaches it, on any thread;PublishInstr.Reason.CONSTANT- any other static store, all in a_c_init: an enumeration's values, a construct's cycle-guard owner - process-wide, read by every thread through the type;PublishInstr.Reason.HANDLER- an argument (or the receiver) of a call that hands it to runtime threads for the life of a server or the program:TCP.accept,acceptUntilComplete,HTTP.serveUntilComplete,Signals.register;PublishInstr.Reason.STORE- the store barrier: a value stored into an object a published one may reach - a property of a[registered]type after construction, or an argument a call may keep in such an object (its receiver or another argument, by the callee's RETAINS). It names thatholder: the value is published only when the holder already is. A store into an object nothing published reaches - most instances of most types, even a registered one made per request - publishes nothing, so a published object never reaches an unpublished one and an unpublished one is never made immortal (review 2026-11-02, M1).
store, only through an already immortal holder.
V-P (PublishVerifier) checks each one is where a fact allows it and that none is missing.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhy a value is published - which fact allows it. -
Constructor Summary
ConstructorsConstructorDescriptionPublishInstr(String value, PublishInstr.Reason reason) A registry, constant or handler publish: the value is published unconditionally.PublishInstr(String value, PublishInstr.Reason reason, String holder) A store barrier: the value is published whenholderis. -
Method Summary
Modifier and TypeMethodDescriptionForPublishInstr.Reason.STORE: the variable (orthis, or a static's owner type) the value is stored into; the value is published only when it is.getValue()The variable whose value is published.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
-
PublishInstr
A registry, constant or handler publish: the value is published unconditionally. -
PublishInstr
A store barrier: the value is published whenholderis.
-
-
Method Details
-
getValue
The variable whose value is published. -
getReason
-
getHolder
ForPublishInstr.Reason.STORE: the variable (orthis, or a static's owner type) the value is stored into; the value is published only when it is. Null for every other reason.
-