Uses of Class
org.ek9lang.compiler.ir.instructions.IRInstr
Packages that use IRInstr
Package
Description
JVM Bytecode Generation - Transforms EK9 IR into JVM bytecode.
Common parts of processing that can be reused across various phases.
IR Data Structures - Metadata and detail classes for IR instructions.
IR Instruction Classes - The instruction set for EK9 intermediate representation.
IR Support Utilities - Helper classes for IR generation and processing.
K - Intermediate Representation Generation.
Synthetic operator and method generation for EK9.
Support classes for synthetic operator IR generation.
M - Intermediate Representation Analysis and Optimization.
-
Uses of IRInstr in org.ek9lang.compiler.backend.jvm
Methods in org.ek9lang.compiler.backend.jvm that return types with arguments of type IRInstrModifier and TypeMethodDescriptionLoopCaseData.body()Returns the value of thebodyrecord component.LoopCaseData.bodySetup()Returns the value of thebodySetuprecord component.LoopCaseData.conditionTemplate()Returns the value of theconditionTemplaterecord component.LoopCaseData.increment()Returns the value of theincrementrecord component.Methods in org.ek9lang.compiler.backend.jvm with parameters of type IRInstrModifier and TypeMethodDescriptionvoidDispatch IRInstr to typed visit methods.Method parameters in org.ek9lang.compiler.backend.jvm with type arguments of type IRInstrModifier and TypeMethodDescriptionprotected voidAbstractControlFlowAsmGenerator.processBodyEvaluation(List<IRInstr> bodyEvaluation) Process body evaluation instructions via recursive visiting.protected voidAbstractControlFlowAsmGenerator.processConditionEvaluation(List<IRInstr> conditionEvaluation) Process condition evaluation instructions via recursive visiting.protected voidAbstractControlFlowAsmGenerator.processInstructions(List<IRInstr> instructions) Process list of IR instructions via recursive delegation to OutputVisitor.Constructor parameters in org.ek9lang.compiler.backend.jvm with type arguments of type IRInstrModifierConstructorDescription(package private)LoopCaseData(org.objectweb.asm.Label loopStart, List<IRInstr> conditionTemplate, String conditionPrimitive, List<IRInstr> bodySetup, ForRangePolymorphicInstr.ValueGuard valueGuard, List<IRInstr> body, ForRangePolymorphicInstr.EndCheck endCheck, List<IRInstr> increment, ForRangePolymorphicInstr.ProgressCheck progressCheck, org.objectweb.asm.Label endLabel, String loopScopeId, BytecodeGenerationContext.DispatchCase dispatchCase) Creates an instance of aLoopCaseDatarecord class. -
Uses of IRInstr in org.ek9lang.compiler.common
Methods in org.ek9lang.compiler.common with parameters of type IRInstr -
Uses of IRInstr in org.ek9lang.compiler.ir.data
Methods in org.ek9lang.compiler.ir.data that return types with arguments of type IRInstrModifier and TypeMethodDescriptionConditionCaseDetails.bodyEvaluation()Returns the value of thebodyEvaluationrecord component.ConditionCaseDetails.conditionEvaluation()Returns the value of theconditionEvaluationrecord component.ControlFlowChainDetails.defaultBodyEvaluation()Get default body evaluation instructions.DefaultCaseDetails.defaultBodyEvaluation()Returns the value of thedefaultBodyEvaluationrecord component.ControlFlowChainDetails.evaluationVariableSetup()Get evaluation variable setup instructions.EvaluationVariableDetails.evaluationVariableSetup()Returns the value of theevaluationVariableSetuprecord component.ControlFlowChainDetails.finallyBlockEvaluation()Returns the value of thefinallyBlockEvaluationrecord component.ControlFlowChainDetails.guardEntryCheck()Get guard entry check instructions (for WHILE/DO-WHILE loops).GuardVariableDetails.guardEntryCheck()Returns the value of theguardEntryCheckrecord component.ControlFlowChainDetails.guardScopeSetup()Get guard scope setup instructions.GuardVariableDetails.guardScopeSetup()Returns the value of theguardScopeSetuprecord component.ConditionCaseDetails.guardUpdates()Returns the value of theguardUpdatesrecord component.ReturnVariableDetails.returnVariableDeclaration()Returns the value of thereturnVariableDeclarationrecord component.ReturnVariableDetails.returnVariableInitialisation()Returns the value of thereturnVariableInitialisationrecord component.ControlFlowChainDetails.returnVariableSetup()Get return variable setup instructions.ReturnVariableDetails.returnVariableSetup()Instructions to set up the return variable: the declaration, then the initialisation.ControlFlowChainDetails.tryBodyEvaluation()Get try body evaluation instructions.TryBlockDetails.tryBodyEvaluation()Returns the value of thetryBodyEvaluationrecord component.Method parameters in org.ek9lang.compiler.ir.data with type arguments of type IRInstrModifier and TypeMethodDescriptionstatic ConditionCaseDetailsConditionCaseDetails.createExceptionHandler(String catchScopeId, String exceptionType, String exceptionVariable, String catchBodyScopeId, List<IRInstr> catchBodyEvaluation, String catchBodyResult) Create a condition case for exception handlers (try/catch blocks).static ConditionCaseDetailsConditionCaseDetails.createExpression(String caseScopeId, List<IRInstr> conditionEvaluation, String conditionResult, String primitiveCondition, List<IRInstr> bodyEvaluation, String bodyResult) Create a condition case for general boolean expressions (if statements).static ConditionCaseDetailsConditionCaseDetails.createLiteral(String caseScopeId, List<IRInstr> conditionEvaluation, String conditionResult, String primitiveCondition, List<IRInstr> bodyEvaluation, String bodyResult) Create a condition case for literal value comparison (switch literal cases).static ConditionCaseDetailsConditionCaseDetails.createNullCheck(String caseScopeId, List<IRInstr> conditionEvaluation, String conditionResult, String primitiveCondition, List<IRInstr> bodyEvaluation, String bodyResult) Create a condition case for the Question operator null check.static ControlFlowChainDetailsControlFlowChainDetails.createSwitchWithGuards(String result, GuardVariableDetails guardDetails, String evaluationVariable, String evaluationVariableType, String returnVariable, String returnVariableType, List<IRInstr> returnVariableSetup, List<ConditionCaseDetails> conditionChain, List<IRInstr> defaultBodyEvaluation, String defaultResult, DebugInfo debugInfo, String scopeId) Create details for a switch statement with guard variable support.static ReturnVariableDetailsReturnVariableDetails.withParts(String returnVariable, String returnVariableType, List<IRInstr> returnVariableDeclaration, List<IRInstr> returnVariableInitialisation) Create return variable details whose setup is known as its two halves - THE structured split a try expression relocates by (FLOW-14a): never re-derive it by scanning the setup's opcodes.static DefaultCaseDetailsDefaultCaseDetails.withResult(List<IRInstr> defaultBodyEvaluation, String defaultResult) Create default case details with instructions and result.static EvaluationVariableDetailsEvaluationVariableDetails.withSetup(String evaluationVariable, String evaluationVariableType, List<IRInstr> evaluationVariableSetup) Create evaluation variable details with setup instructions.static ReturnVariableDetailsReturnVariableDetails.withSetup(String returnVariable, String returnVariableType, List<IRInstr> returnVariableSetup) Create return variable details with setup instructions that are not split into declaration and initialisation (the whole setup is the initialisation).Constructor parameters in org.ek9lang.compiler.ir.data with type arguments of type IRInstrModifierConstructorDescriptionConditionCaseDetails(String caseScopeId, String caseType, List<IRInstr> guardUpdates, String bodyScopeId, String enumConstant, int enumOrdinal, List<IRInstr> conditionEvaluation, String conditionResult, String primitiveCondition, List<IRInstr> bodyEvaluation, String bodyResult, String exceptionType, String exceptionVariable) Creates an instance of aConditionCaseDetailsrecord class.DefaultCaseDetails(List<IRInstr> defaultBodyEvaluation, String defaultResult) Creates an instance of aDefaultCaseDetailsrecord class.EvaluationVariableDetails(String evaluationVariable, String evaluationVariableType, List<IRInstr> evaluationVariableSetup) Creates an instance of aEvaluationVariableDetailsrecord class.ReturnVariableDetails(String returnVariable, String returnVariableType, List<IRInstr> returnVariableSetup) Return variable details whose setup is not split (the whole setup is the initialisation) - the record's shape before FLOW-14a, kept so a construction written against it still compiles; preferReturnVariableDetails.withSetup(String, String, List).ReturnVariableDetails(String returnVariable, String returnVariableType, List<IRInstr> returnVariableDeclaration, List<IRInstr> returnVariableInitialisation) Creates an instance of aReturnVariableDetailsrecord class.TryBlockDetails(String tryScopeId, List<IRInstr> tryBodyEvaluation, String tryBodyResult, String resourceScopeId) Creates an instance of aTryBlockDetailsrecord class. -
Uses of IRInstr in org.ek9lang.compiler.ir.instructions
Subclasses of IRInstr in org.ek9lang.compiler.ir.instructionsModifier and TypeClassDescriptionfinal classHigh-level IR instruction for creating an aspect-woven proxy.final classIR instruction for test-only assertion constructs that wrap expressions in try-catch.final classSpecialized IR instruction for control flow operations (BRANCH, BRANCH_TRUE, BRANCH_FALSE, ASSERT, RETURN).final classSpecialized IR instruction for method calls (CALL, CALL_VIRTUAL, CALL_STATIC, CALL_DISPATCHER).final classCANCEL_POINT: a point where an async task the pipeline no longer needs stops (EK9_BACKEND_IR_CONTRACTS.md Contract 24).final classIR instruction for explicit type casting.final classUnified IR instruction for all EK9 control flow constructs.final classSpecialized IR instruction for coverage finalization (COVERAGE_FINALIZE).final classSpecialized IR instruction for coverage probe recording (COVERAGE_PROBE).final classSpecialized IR instruction for coverage module registration (COVERAGE_REGISTER).final classIR instruction for dict literal construction with pre-sized allocation.final classHigh-level IR instruction for a precomputed dispatch table.final classHigh-level IR instruction for generating enum iterator implementation.final classSpecialized IR instruction for EK9 polymorphic for-range loops.final classSpecialised IR instruction for the input-variation numerator (INPUT_CLASS_PROBE).final classSpecialized IR instruction for control flow labels (LABEL).final classIR instruction for list literal construction with pre-sized allocation.final classIR instruction for loading literal/constant values.final classIR instruction for logical operations (AND/OR) with short-circuit capability.final classSpecialized IR instruction for memory operations (LOAD, STORE, ALLOCA, REFERENCE).final classThe ownership form of the IR (EK9_IR_OWNERSHIP_MODEL.md §10):OWN,DROP,DROP_AT_EXIT,SLOT_DECLARE,SLOT_ASSIGN,FIELD_ASSIGN.final classIR instruction for loading primitive literal values (int, boolean, java.lang.String).final classSpecialized IR instruction for profiling function entry (PROFILING_ENTRY).final classSpecialized IR instruction for profiling function exit (PROFILING_EXIT).final classIR instruction containing all discovered programs and their metadata.final classPUBLISH 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).final classSAFE_POINT: a point where the native cycle collector may run (EK9_NATIVE_CYCLE_COLLECTOR_DESIGN.md §14).final classIR instruction for sanitizing string values to prevent injection attacks.final classSpecialized IR instruction for scope management (SCOPE_ENTER, SCOPE_EXIT, SCOPE_REGISTER).final classIR instruction for string interpolation.final classSpecialized IR instruction for throwing exceptions (THROW).Classes in org.ek9lang.compiler.ir.instructions that implement interfaces with type arguments of type IRInstrModifier and TypeClassDescriptionfinal classTHE flattening of the instructions a back end EXECUTES in an instruction list: every instruction, depth-first through every nested list a back end runs - a chain's condition cases (guardUpdates,conditionEvaluation,bodyEvaluation), its default, try body and finally, and a for-range loop's initialisation, continue condition, direction/condition/setup/guard/increment/progress lists and body (the walkIRConstruct.allBodyInstructions()describes).final classTHE executed instructions of one operation (one callable), flattened asExecutedInstructionsIndescribes - the per-callable unit an IR analysis reads.Methods in org.ek9lang.compiler.ir.instructions that return IRInstrModifier and TypeMethodDescriptionIRInstr.addOperand(String operand) Add operand to this instruction.IRInstr.addOperands(String... operands) Add multiple operands to this instruction.static IRInstrLogicalOperationInstr.andOperation(LogicalDetails logicalDetails) Create logical AND operation.BasicBlockInstr.getLastInstruction()Get the last instruction in this block (usually control flow).static IRInstrLogicalOperationInstr.orOperation(LogicalDetails logicalDetails) Create logical OR operation.AssertThrowsInstr.withNestedLists(UnaryOperator<List<IRInstr>> rewrite) CompositeInstr.withNestedLists(UnaryOperator<List<IRInstr>> rewrite) A copy with every nested list replaced byrewriteof it - exactly the listsCompositeInstr.nestedLists()reports, in that order;thiswhen no list changed.ControlFlowChainInstr.withNestedLists(UnaryOperator<List<IRInstr>> rewrite) DictLiteralInstr.withNestedLists(UnaryOperator<List<IRInstr>> rewrite) ForRangePolymorphicInstr.withNestedLists(UnaryOperator<List<IRInstr>> rewrite) ListLiteralInstr.withNestedLists(UnaryOperator<List<IRInstr>> rewrite) LogicalOperationInstr.withNestedLists(UnaryOperator<List<IRInstr>> rewrite) StringInterpolationInstr.withNestedLists(UnaryOperator<List<IRInstr>> rewrite) Methods in org.ek9lang.compiler.ir.instructions that return types with arguments of type IRInstrModifier and TypeMethodDescriptionIRConstruct.allBodyInstructions()THE single IR-tree traversal for this construct: every instruction in every operation body, flattened depth-first through every nested instruction list the back-end executes.ExecutedInstructionsOf.apply(OperationInstr operation) ForRangePolymorphicInstr.AscendingCase.directionCheck()Returns the value of thedirectionCheckrecord component.ForRangePolymorphicInstr.DescendingCase.directionCheck()Returns the value of thedirectionCheckrecord component.ForRangePolymorphicInstr.EqualCase.directionCheck()Returns the value of thedirectionCheckrecord component.ForRangePolymorphicInstr.ContinueCondition.evaluation()Returns the value of theevaluationrecord component.ForRangePolymorphicInstr.ProgressCheck.evaluation()Returns the value of theevaluationrecord component.ForRangePolymorphicInstr.ValueGuard.evaluation()Returns the value of theevaluationrecord component.ForRangePolymorphicInstr.getBodyInstructions()ControlFlowChainInstr.getDefaultBodyEvaluation()Get the default/else case evaluation instructions.ControlFlowChainInstr.getEvaluationVariableSetup()The instructions that evaluate this chain's control/evaluation variable (a guard'sswitch v <- ...).AssertThrowsInstr.getExpressionBodyInstructions()Get the expression body instructions to evaluate within the try block.ControlFlowChainInstr.getFinallyBlockEvaluation()ForRangePolymorphicInstr.getInitializationInstructions()BasicBlockInstr.getInstructions()LogicalOperationInstr.getLeftEvaluationInstructions()Get the left operand evaluation instructions.BasicBlockInstr.getMemoryManagementInstructions()Get all memory management instructions in this block.BasicBlockInstr.getMethodCalls()Get all method call instructions in this block.LogicalOperationInstr.getResultComputationInstructions()Get the result computation instructions.ControlFlowChainInstr.getReturnVariableSetup()The instructions that declare/initialise this chain's RETURN variable (the<- rtn <- ...of an expression-form try/switch/if).LogicalOperationInstr.getRightEvaluationInstructions()Get the right operand evaluation instructions.DictLiteralInstr.getSetupInstructions()Get the setup instructions (key/value evaluation + memory management).ListLiteralInstr.getSetupInstructions()Get the setup instructions (element evaluation + memory management).StringInterpolationInstr.getSetupInstructions()Get the setup instructions ($ operator calls for non-String expressions).CompositeInstr.NestedList.instructions()Returns the value of theinstructionsrecord component.ForRangePolymorphicInstr.AscendingCase.loopBodySetup()Returns the value of theloopBodySetuprecord component.ForRangePolymorphicInstr.DescendingCase.loopBodySetup()Returns the value of theloopBodySetuprecord component.ForRangePolymorphicInstr.EqualCase.loopBodySetup()Returns the value of theloopBodySetuprecord component.ForRangePolymorphicInstr.AscendingCase.loopConditionTemplate()Returns the value of theloopConditionTemplaterecord component.ForRangePolymorphicInstr.DescendingCase.loopConditionTemplate()Returns the value of theloopConditionTemplaterecord component.ForRangePolymorphicInstr.AscendingCase.loopIncrement()Returns the value of theloopIncrementrecord component.ForRangePolymorphicInstr.DescendingCase.loopIncrement()Returns the value of theloopIncrementrecord component.Null-safe application of a list rewrite: an absent list stays absent.Methods in org.ek9lang.compiler.ir.instructions with parameters of type IRInstrModifier and TypeMethodDescriptionBasicBlockInstr.addInstruction(IRInstr instruction) Add instruction to this basic block.BasicBlockInstr.addInstructions(IRInstr... instructions) Add multiple instructions to this basic block.BasicBlockInstr.prependInstruction(IRInstr instruction) Prepend instruction to the beginning of this basic block.Method parameters in org.ek9lang.compiler.ir.instructions with type arguments of type IRInstrModifier and TypeMethodDescriptionBasicBlockInstr.addInstructions(List<IRInstr> instructions) Add multiple instructions from a list.(package private) voidSetupBlockRendering.appendSetupBlock(StringBuilder sb, String label, List<IRInstr> setupInstructions, String scopeId) Append a nested setup block, if there is any setup to show.static AssertThrowsInstrAssertThrowsInstr.assertDoesNotThrow(List<IRInstr> bodyInstructions, String message, String scopeId, DebugInfo debugInfo) Create ASSERT_DOES_NOT_THROW instruction.static AssertThrowsInstrAssertThrowsInstr.assertPanic(String result, List<IRInstr> bodyInstructions, String message, String scopeId, DebugInfo debugInfo) Create ASSERT_PANIC instruction.static AssertThrowsInstrAssertThrowsInstr.assertThrows(String result, String expectedType, List<IRInstr> bodyInstructions, String message, String scopeId, DebugInfo debugInfo) Create ASSERT_THROWS instruction.static DictLiteralInstrDictLiteralInstr.create(String result, List<IRInstr> setupInstructions, DictLiteralDetails details, String scopeId, DebugInfo debugInfo) Create a dict literal instruction.static ListLiteralInstrListLiteralInstr.create(String result, List<IRInstr> setupInstructions, ListLiteralDetails details, String scopeId, DebugInfo debugInfo) Create a list literal instruction.static ForRangePolymorphicInstrForRangePolymorphicInstr.forRangePolymorphic(List<IRInstr> initializationInstructions, ForRangePolymorphicInstr.DispatchCases dispatchCases, ForRangePolymorphicInstr.LoopMetadata metadata, List<IRInstr> bodyInstructions, ForRangePolymorphicInstr.ScopeMetadata scopeMetadata, ForRangePolymorphicInstr.ContinueCondition continueCondition, DebugInfo debugInfo) Create a polymorphic for-range loop instruction whose iterations are also bounded by aForRangePolymorphicInstr.ContinueCondition(a stream'shead: decision 10, rule B).static ForRangePolymorphicInstrForRangePolymorphicInstr.forRangePolymorphic(List<IRInstr> initializationInstructions, ForRangePolymorphicInstr.DispatchCases dispatchCases, ForRangePolymorphicInstr.LoopMetadata metadata, List<IRInstr> bodyInstructions, ForRangePolymorphicInstr.ScopeMetadata scopeMetadata, DebugInfo debugInfo) Create a polymorphic for-range loop instruction.static StringInterpolationInstrStringInterpolationInstr.interpolate(String result, List<IRInstr> setupInstructions, List<StringInterpolationPart> parts, String scopeId, DebugInfo debugInfo) Create a string interpolation instruction.Null-safe application of a list rewrite: an absent list stays absent.Null-safe application of a list rewrite: an absent list stays absent.AssertThrowsInstr.withNestedLists(UnaryOperator<List<IRInstr>> rewrite) CompositeInstr.withNestedLists(UnaryOperator<List<IRInstr>> rewrite) A copy with every nested list replaced byrewriteof it - exactly the listsCompositeInstr.nestedLists()reports, in that order;thiswhen no list changed.ControlFlowChainInstr.withNestedLists(UnaryOperator<List<IRInstr>> rewrite) DictLiteralInstr.withNestedLists(UnaryOperator<List<IRInstr>> rewrite) ForRangePolymorphicInstr.withNestedLists(UnaryOperator<List<IRInstr>> rewrite) ListLiteralInstr.withNestedLists(UnaryOperator<List<IRInstr>> rewrite) LogicalOperationInstr.withNestedLists(UnaryOperator<List<IRInstr>> rewrite) StringInterpolationInstr.withNestedLists(UnaryOperator<List<IRInstr>> rewrite) Constructor parameters in org.ek9lang.compiler.ir.instructions with type arguments of type IRInstrModifierConstructorDescriptionAscendingCase(List<IRInstr> directionCheck, String directionPrimitive, List<IRInstr> loopConditionTemplate, String loopConditionPrimitive, List<IRInstr> loopBodySetup, ForRangePolymorphicInstr.ValueGuard valueGuard, ForRangePolymorphicInstr.EndCheck endCheck, List<IRInstr> loopIncrement, ForRangePolymorphicInstr.ProgressCheck progressCheck) Creates an instance of aAscendingCaserecord class.ContinueCondition(List<IRInstr> evaluation, String primitive) Creates an instance of aContinueConditionrecord class.DescendingCase(List<IRInstr> directionCheck, String directionPrimitive, List<IRInstr> loopConditionTemplate, String loopConditionPrimitive, List<IRInstr> loopBodySetup, ForRangePolymorphicInstr.ValueGuard valueGuard, ForRangePolymorphicInstr.EndCheck endCheck, List<IRInstr> loopIncrement, ForRangePolymorphicInstr.ProgressCheck progressCheck) Creates an instance of aDescendingCaserecord class.EqualCase(List<IRInstr> directionCheck, String directionPrimitive, List<IRInstr> loopBodySetup, ForRangePolymorphicInstr.ValueGuard valueGuard, boolean singleIteration) Creates an instance of aEqualCaserecord class.NestedList(String role, List<IRInstr> instructions, CompositeInstr.Activation activation) Creates an instance of aNestedListrecord class.ProgressCheck(List<IRInstr> evaluation, String primitive) Creates an instance of aProgressCheckrecord class.ValueGuard(List<IRInstr> evaluation, String primitive) Creates an instance of aValueGuardrecord class. -
Uses of IRInstr in org.ek9lang.compiler.ir.support
Methods in org.ek9lang.compiler.ir.support that return types with arguments of type IRInstrModifier and TypeMethodDescriptionRewrite an instruction list; the same list when nothing in it (at any depth) changed.IRRewriter.rewriteLists(List<IRInstr> instructions, UnaryOperator<List<IRInstr>> listRewrite) Rewrite a list and every list nested in it, bottom-up;listRewritereturns its argument unchanged (the same list) when it changes nothing.Methods in org.ek9lang.compiler.ir.support with parameters of type IRInstrModifier and TypeMethodDescriptionvoidIRStructureWalk.Visitor.instruction(IRInstr instruction) Each instruction, before any of its nested lists.static ValueKindThe kind of the valueinstructionmakes; null when it makes none, or states none (aSTORE, and aCAST, which forwards its operand's kind - V-D).Method parameters in org.ek9lang.compiler.ir.support with type arguments of type IRInstrModifier and TypeMethodDescriptionRewrite an instruction list; the same list when nothing in it (at any depth) changed.Rewrite an instruction list; the same list when nothing in it (at any depth) changed.Rewrite an instruction list; the same list when nothing in it (at any depth) changed.voidRewrite an operation's body in place (the operation takes the rebuilt body, or keeps its own when nothing changed).voidRewrite an operation's body in place (the operation takes the rebuilt body, or keeps its own when nothing changed).IRRewriter.rewriteLists(List<IRInstr> instructions, UnaryOperator<List<IRInstr>> listRewrite) Rewrite a list and every list nested in it, bottom-up;listRewritereturns its argument unchanged (the same list) when it changes nothing.IRRewriter.rewriteLists(List<IRInstr> instructions, UnaryOperator<List<IRInstr>> listRewrite) Rewrite a list and every list nested in it, bottom-up;listRewritereturns its argument unchanged (the same list) when it changes nothing.voidIRRewriter.rewriteLists(OperationInstr operation, UnaryOperator<List<IRInstr>> listRewrite) Rewrite an operation's body list by list: every nested list first (bottom-up), then the list that holds it.voidIRStructureWalk.walk(List<IRInstr> instructions, IRStructureWalk.Visitor visitor) Walk an instruction list and everything nested in it. -
Uses of IRInstr in org.ek9lang.compiler.phase7
Methods in org.ek9lang.compiler.phase7 that return types with arguments of type IRInstrModifier and TypeMethodDescriptionAggregateDfnGenerator.beforeInstanceInit(OperationInstr operation) What a constructor does between its construction call and its_i_init, while its body is built: nothing, but for a dynamic class's capture constructor (DynamicClassDfnGenerator), which stores the captured values there.DynamicClassDfnGenerator.beforeInstanceInit(OperationInstr operation) The capture stores, in THE capture constructor only.AbstractDfnGenerator.processPropertiesForInstanceInit(EK9Parser.AggregatePartsContext ctx) Process all properties for instance initialization - THE sharedPropertyInitialisers.Method parameters in org.ek9lang.compiler.phase7 with type arguments of type IRInstrModifier and TypeMethodDescription(package private) voidScenario2WrapperHelper.borrow(List<IRInstr> instructions, String value, String scopeId, DebugInfo debugInfo) A value this scope does not own - a LOAD of a field or parameter, or a CAST alias of a value owned elsewhere - borrowed for the scope:OwnershipStatements.borrowInScope(String, String, DebugInfo).(package private) StringScenario2WrapperHelper.castBorrowed(List<IRInstr> instructions, String value, String typeName, String scopeId, DebugInfo debugInfo) A value this scope does not own, CAST totypeNameand the cast borrowed for the scope (a parameter given asAny).(package private) StringScenario2WrapperHelper.castWhenThisWrapper(List<IRInstr> instructions, String operandName, String notThisWrapperLabel, String scopeId, DebugInfo debugInfo) THE test of an operand declaredAnyfor being exactly THIS wrapper, and its cast when it is - shared by wrapper equality (Scenario2EqualityGenerator) and every other operator the generic declares as takingAny(Scenario2AggregateWrapperGenerator, D60:DictEntry <=> Any).(package private) StringConstrainedTypeInstrs.constructorCall(List<IRInstr> instructions, String typeName, List<String> parameterTypes, List<String> arguments, CallMetaDataDetails metaData, DebugInfo debugInfo) THE constructor call on a type made here:CALL typeName.<init>(arguments)- its +1 result's owner is the caller's to state.(package private) StringConstrainedTypeInstrs.copyBaseValue(List<IRInstr> instructions, String sourceVar, DebugInfo debugInfo) Produce the constrained type's own copy of a base-type value, on both boundaries - storing a constructor argument (copy-in) and returning a promoted value (copy-out) - so a later in-place change to the caller's value does not reach the constrained value and bypass its constraint.(package private) BasicBlockInstrConstrainedTypeInstrs.createBasicBlock(List<IRInstr> instructions) (package private) BasicBlockInstrScenario2WrapperHelper.createBasicBlock(List<IRInstr> instructions) (package private) voidConstraintLowering.emitConstraintCheck(List<IRInstr> instructions, String subjectVar, String scopeId, DebugInfo debugInfo) Emit the constraint check onsubjectVar(a base-type value).(package private) voidConstraintLowering.emitViabilityCheck(List<IRInstr> instructions, String subjectVar, String scopeId, DebugInfo debugInfo) Evaluate whethersubjectVaris a USABLE value for this constrained type - it is set AND satisfies the constraint - and store that Boolean as the first_viable.(package private) StringScenario2WrapperHelper.emitVirtualCall(List<IRInstr> instructions, String targetVar, String targetType, ISymbol targetTypeSymbol, String methodName, List<String> paramTypes, String returnType, List<String> argNames, DebugInfo debugInfo) A virtual method call whose result (+1) the caller states the owner of itself - it casts it (Scenario2WrapperHelper.ownedCast(List, String, String, String, DebugInfo)) or moves it.(package private) StringScenario2WrapperHelper.extractPrimitiveBoolean(List<IRInstr> instructions, String booleanVar, DebugInfo debugInfo) Extract primitive boolean from Boolean object via _true() method.(package private) StringScenario2WrapperHelper.generateConstructorCall(List<IRInstr> instructions, ISymbol type, boolean externallyLinked, String typeName, List<String> paramTypes, List<String> argNames, DebugInfo debugInfo) A constructor call whose new value (+1) the caller states the owner of itself (it moves it).(package private) StringScenario2WrapperHelper.generateConstructorCallInstructions(List<IRInstr> instructions, ISymbol type, String typeName, List<String> paramTypes, List<String> argNames, String scopeId, DebugInfo debugInfo) Generate a constructor call on a type: the new value (+1) is owned by the scope, dropped at its exit.(package private) StringScenario2WrapperHelper.generateProducerVirtualCall(List<IRInstr> instructions, String targetVar, String targetType, ISymbol targetTypeSymbol, String methodName, List<String> paramTypes, String returnType, List<String> argNames, String scopeId, DebugInfo debugInfo) Generate a virtual method call whose result is a +1 PRODUCER — a value-method or operator that hands back a freshly-owned object (e.g.(package private) StringScenario2WrapperHelper.generateUnsetBoolean(List<IRInstr> instructions, String scopeId, DebugInfo debugInfo) Generate an unset Boolean constructor call.(package private) StringConstrainedTypeInstrs.isSetOf(List<IRInstr> instructions, String subjectVar, String scopeId, DebugInfo debugInfo) subject._isSet()on a BASE value, through THE?call (IsSetCallDetailsCreator): its +1 Boolean is dropped atscopeId's exit (registered only - as a branch condition it is not kept).(package private) StringConstrainedTypeInstrs.loadDelegate(List<IRInstr> instructions, String objectVar, String scopeId, DebugInfo debugInfo) The delegate ofobjectVar(a value of this constrained type), borrowed for the scope: THE delegate load (DelegateLoad).(package private) StringScenario2WrapperHelper.loadDelegate(List<IRInstr> instructions, String wrapperVar, String scopeId, DebugInfo debugInfo) The delegate ofwrapperVar, a value of THIS wrapper's type, borrowed for the scope.(package private) StringScenario2WrapperHelper.loadDelegate(List<IRInstr> instructions, String scopeId, DebugInfo debugInfo) This wrapper's own delegate (this.delegate), borrowed for the scope.(package private) StringScenario2WrapperHelper.loadDelegateOf(List<IRInstr> instructions, String wrapperVar, String wrapperType, String delegateFieldType, String scopeId, DebugInfo debugInfo) THE delegate load of the Scenario-2 wrappers: a wrapper value'sdelegatefield, borrowed for the scope (DelegateLoad, shared with the constrained types).(package private) voidScenario2WrapperHelper.owned(List<IRInstr> instructions, String value, String scopeId, DebugInfo debugInfo) A value just made (+1) that this scope owns and drops at its exit:OwnershipStatements.droppedAtExit(String, String, DebugInfo).(package private) StringScenario2WrapperHelper.ownedCast(List<IRInstr> instructions, String value, String typeName, String scopeId, DebugInfo debugInfo) A value just made (+1), cast totypeName: the CAST takes the value's count (V-D) and the scope owns the cast, dropping it at exit - one count, one drop, whichever name holds the object.protected voidAbstractDfnGenerator.processAsMethodOrOperator(OperationInstr operation, EK9Parser.OperationDetailsContext ctx, List<IRInstr> beforeInstanceInit) AbstractDfnGenerator.processAsMethodOrOperator(OperationInstr, EK9Parser.OperationDetailsContext), withbeforeInstanceInit- an explicit capture constructor's capture stores (CaptureStores) - just after the constructor's construction call, before its_i_init.protected voidAbstractDfnGenerator.processSyntheticConstructor(OperationInstr operation, List<IRInstr> beforeInstanceInit) AbstractDfnGenerator.processSyntheticConstructor(OperationInstr), withbeforeInstanceInit- a dynamic function's or a dynamic class's capture stores (CaptureStores) - between the super call and_i_init.(package private) voidScenario2WrapperHelper.returnFresh(List<IRInstr> instructions, String value, DebugInfo debugInfo) A value just made (+1), moved into the return variable (empty here):OwnershipStatements.returnFresh(String, String, DebugInfo)- the caller receives the producer's count.(package private) voidScenario2WrapperHelper.returnVirtualCall(List<IRInstr> instructions, String targetVar, String targetType, ISymbol targetTypeSymbol, String methodName, List<String> paramTypes, String returnType, List<String> argNames, String scopeId, DebugInfo debugInfo) A virtual method call whose result (+1) is moved straight into the return variable: the method hands its caller exactly the count the callee handed it.(package private) StringScenario2WrapperHelper.rewrapRawDelegate(List<IRInstr> instructions, String rawVar, PossibleGenericSymbol wrapper, String scopeId, DebugInfo debugInfo) THE wrap of a RAW delegate value back into its built-in parameterised wrapper (the inverse ofScenario2WrapperHelper.unwrapDelegate(List, String, PossibleGenericSymbol, String, DebugInfo)):wrapper(rawVar), the new wrapper owned by the scope.(package private) voidConstrainedTypeInstrs.storeDelegate(List<IRInstr> instructions, String value, DebugInfo debugInfo) THE first store intothis._delegate(in _i_init, or a constructor): the field takes its own reference to a value its scope owns - FIELD_ASSIGN [copy, init].(package private) voidScenario2WrapperHelper.storeDelegateField(List<IRInstr> instructions, String value, DebugInfo debugInfo) The wrapper's delegate field, its first store in a constructor: the field takes its own reference to a value the constructor's scope still owns (FIELD_ASSIGN [copy, init]).(package private) voidConstrainedTypeInstrs.storeFirstViable(List<IRInstr> instructions, String value, DebugInfo debugInfo) THE first store intothis._viable(in _i_init): FIELD_ASSIGN [copy, init] of a value its scope owns.(package private) voidScenario2WrapperHelper.storeUnsetBooleanReturn(List<IRInstr> instructions, String scopeId, DebugInfo debugInfo) An unset Boolean as the return value: made, and moved into the return variable (empty here).(package private) voidConstrainedTypeInstrs.storeViable(List<IRInstr> instructions, String scopeId, DebugInfo debugInfo) THE store ofthis._viable = true: after a value has been accepted by the constraint check (a breach Panics before reaching here).(package private) StringScenario2WrapperHelper.unwrapDelegate(List<IRInstr> instructions, String wrapperVar, PossibleGenericSymbol parameterizedType, String scopeId, DebugInfo debugInfo) Load the raw delegate out of a built-in parameterised wrapper value (List of Integer-> itsList), for a base-type call that takes the raw type, borrowed for the scope.(package private) StringConstraintLowering.walkConstraint(EK9Parser.ConstrainTypeContext ctx, String subjectVar, List<IRInstr> instructions, String scopeId, DebugInfo debugInfo) Lower theconstrainTypeparse tree to IR oversubjectVar, returning the temp holding the resulting Boolean. -
Uses of IRInstr in org.ek9lang.compiler.phase7.calls
Methods in org.ek9lang.compiler.phase7.calls that return types with arguments of type IRInstrModifier and TypeMethodDescriptionCallDetailsBuilder.CallDetailsResult.allInstructions()Returns the value of theallInstructionsrecord component.Constructor parameters in org.ek9lang.compiler.phase7.calls with type arguments of type IRInstrModifierConstructorDescriptionCallDetailsResult(CallDetails callDetails, List<IRInstr> allInstructions) Creates an instance of aCallDetailsResultrecord class. -
Uses of IRInstr in org.ek9lang.compiler.phase7.generation
Methods in org.ek9lang.compiler.phase7.generation that return IRInstrModifier and TypeMethodDescriptionCoverageProbePlacer.createBranchFalseProbe(DebugInfo debugInfo) Create a branch-false (else) probe instruction.CoverageProbePlacer.createBranchTrueProbe(DebugInfo debugInfo) Create a branch-true (if/then) probe instruction.CoverageProbePlacer.createCatchBlockProbe(String exceptionType, DebugInfo debugInfo) Create a catch block probe instruction.CoverageProbePlacer.createCoverageFinalization(DebugInfo debugInfo) Create a coverage finalization instruction.CoverageProbePlacer.createFinallyBlockProbe(DebugInfo debugInfo) Create a finally block probe instruction.CoverageProbePlacer.createFunctionEntryProbe(DebugInfo debugInfo) Create a function entry probe instruction.CoverageProbePlacer.createLoopBodyProbe(DebugInfo debugInfo) Create a loop body probe instruction.CoverageProbePlacer.createModuleRegistration(DebugInfo debugInfo) Create a module registration instruction.CoverageProbePlacer.createProfilingEntryProbe(DebugInfo debugInfo) Create a profiling entry probe instruction.CoverageProbePlacer.createProfilingExitProbe(DebugInfo debugInfo) Create a profiling exit probe instruction.CoverageProbePlacer.createStatementProbe(DebugInfo debugInfo) Create a statement probe instruction.CoverageProbePlacer.createSwitchCaseProbe(String caseLabel, DebugInfo debugInfo) Create a switch case probe instruction.Methods in org.ek9lang.compiler.phase7.generation that return types with arguments of type IRInstrModifier and TypeMethodDescriptionCreate an input-class probe for a public construct's entry (the dynamic numerator, §5).IRGenerationContext.extractInstructions()Get current instruction list and clear it.IRInstructionBuilder.extractInstructions()Extract all built instructions and clear the builder.Methods in org.ek9lang.compiler.phase7.generation with parameters of type IRInstrModifier and TypeMethodDescriptionvoidIRGenerationContext.addInstruction(IRInstr instruction) Add instruction to current instruction list.voidIRInstructionBuilder.addInstruction(IRInstr instruction) Add a raw instruction to the current context.Method parameters in org.ek9lang.compiler.phase7.generation with type arguments of type IRInstrModifier and TypeMethodDescriptionvoidIRGenerationContext.addInstructions(List<IRInstr> instructions) Add multiple instructions to current instruction list.voidIRInstructionBuilder.addInstructions(List<IRInstr> instructions) Add multiple raw instructions to the current context. -
Uses of IRInstr in org.ek9lang.compiler.phase7.generator
Classes in org.ek9lang.compiler.phase7.generator that implement interfaces with type arguments of type IRInstrModifier and TypeClassDescription(package private) classBoth AND/OR are very similar in processing, the only real differences are:
What operation to call and the op code to generate.final classIR Generation for the assertDoesNotThrow expression.final classIR Generation for the assertPanic expression.final classIR Generation for the assert statement.final classIR Generation for the assertThrows expression.(package private) final classTHE assignment of an assignmentExpression to a symbol (the expression is generated bygenerators.assignmentExprGenerator), in one of twoAssignExpressionToSymbol.Modes - TWO per construct on the set,generators.assignToNewSymbolandgenerators.assignToExistingSymbol(IR tidy W3.9, EXPR-15), never one per assignment.(package private) final classAssign-if-unset generator using unified CONTROL_FLOW_CHAIN approach.(package private) final classCreates IR instructions for assignment expressions.final classProcess assignment statement: variable = expression Uses RELEASE-then-RETAIN pattern for memory-safe assignments.final classGenerates IR instructions for binary operations (e.g., addition, subtraction, comparison, etc.).final classCreates IR instructions for block statements.final classGenerates IR instructions for function/method calls.final classUnified IR generator for EK9 control flow operators using CONTROL_FLOW_CHAIN.final classGenerates IR instructions for dict literal expressions.final classCreates IR instructions for expressions.final classGenerates IR for for-in loops and expressions: for item in collection.final classGenerates IR for for-range loops and expressions using FOR_RANGE_POLYMORPHIC instruction.final classCoordinates for-statement IR generation by delegating to specialized generators.final classUnified function call processor using CallDetailsBuilder for method resolution and promotion.final classUnified function call processor using CallDetailsBuilder for method resolution and promotion.final classGenerates IR for if/else statements using CONTROL_FLOW_CHAIN.final classGenerates IR instructions for interpolated string expressions.final classGenerates IR instructions for list literal expressions.(package private) final classDeals with generating the correct IR Instructions for processing any form of literal.final classGenerates IR instructions for primary references (THIS and SUPER keywords).final classTHE instance initialisation of a type's properties, in declaration order - the body of its_i_init.final classGenerates IR instructions for question operator (?) using unified SWITCH_CHAIN_BLOCK.final classIR Generation for the require statement.final classCreates IR instructions for statements.final classGenerates IR for stream statement pipelines: source | stages | > terminal.final classGenerates IR for switch statements and expressions using CONTROL_FLOW_CHAIN.final classGenerates IR for throw statements.final classGenerates IR for try/catch/finally constructs using CONTROL_FLOW_CHAIN.final classGenerates IR instructions for unary operations (e.g., unary minus, increment, decrement, etc.).final classCreates IR instructions for variable declarations.final classCreates IR instructions for variable only declarations.final classGenerates IR for while and do-while loops and expressions using CONTROL_FLOW_CHAIN.Methods in org.ek9lang.compiler.phase7.generator that return IRInstrModifier and TypeMethodDescriptionResourceCloser.closeCall(ResourceCloser.Closing closing) CALL variable._close()on the type that declaresclose.FunctionProbes.Registered.coverageEntry()Returns the value of thecoverageEntryrecord component.ApplicationClose.declare(ResourceCloser.FirstFailure firstFailure, DebugInfo debugInfo) ResourceCloser.declareFirstFailure(ResourceCloser.FirstFailure firstFailure, DebugInfo debugInfo) SLOT_DECLARE firstFailure, org.ek9.lang::Exception, owner- null until a failure is recorded.FunctionProbes.Registered.profilingEntry()Returns the value of theprofilingEntryrecord component.FunctionProbes.Registered.profilingExit()Returns the value of theprofilingExitrecord component.Methods in org.ek9lang.compiler.phase7.generator that return types with arguments of type IRInstrModifier and TypeMethodDescriptionDeclarationParts.all()The whole declaration: the declaration, then the initialisation.AbstractShortCircuitGenerator.apply(ExprProcessingDetails details) AssertDoesNotThrowExprGenerator.apply(EK9Parser.AssertDoesNotThrowExpressionContext ctx) Generate IR for assertDoesNotThrow expression.AssertPanicExprGenerator.apply(EK9Parser.AssertPanicExpressionContext ctx, String resultVar) Generate IR for assertPanic expression.AssertStmtGenerator.apply(EK9Parser.AssertStatementContext ctx) AssertThrowsExprGenerator.apply(EK9Parser.AssertThrowsExpressionContext ctx, String resultVar) Generate IR for assertThrows expression.AssignExpressionToSymbol.apply(ISymbol lhsSymbol, EK9Parser.AssignmentExpressionContext ctx) AssignIfUnsetBlockGenerator.apply(AssignIfUnsetDetails details) AssignmentExprInstrGenerator.apply(EK9Parser.AssignmentExpressionContext ctx, String rhsExprResult) Generate IR instructions for an assignment expression intorhsExprResult.AssignmentStmtGenerator.apply(EK9Parser.AssignmentStatementContext ctx) BinaryOperationGenerator.apply(ExprProcessingDetails details) BlockStmtInstrGenerator.apply(EK9Parser.BlockStatementContext ctx) Generate IR instructions for a block statement using stack-based scope management.CallInstrGenerator.apply(EK9Parser.CallContext ctx, VariableDetails resultDetails) ControlFlowChainGenerator.apply(ControlFlowChainDetails details) DictLiteralGenerator.apply(ExprProcessingDetails details) ExprInstrGenerator.apply(ExprProcessingDetails details) Generate IR instructions for expression.ForInGenerator.apply(EK9Parser.ForStatementExpressionContext ctx) ForRangeGenerator.apply(EK9Parser.ForStatementExpressionContext ctx) Main orchestration method for for-range loop IR generation.ForStatementGenerator.apply(EK9Parser.ForStatementExpressionContext ctx) Main entry point for for-statement IR generation.FunctionCallProcessor.apply(CallProcessingDetails details, Function<ExprProcessingDetails, List<IRInstr>> exprProcessor) Apply function call processing with an expression processor function.IfStatementGenerator.apply(EK9Parser.IfStatementContext ctx) InterpolatedStringGenerator.apply(ExprProcessingDetails details) ListLiteralGenerator.apply(ExprProcessingDetails details) LiteralGenerator.apply(LiteralProcessingDetails details) ObjectAccessInstrGenerator.apply(EK9Parser.ObjectAccessExpressionContext ctx, VariableDetails variableDetails) Generate IR instructions for object access expression using resolved symbols.PrimaryReferenceGenerator.apply(PrimaryReferenceProcessingDetails details) PropertyInitialisers.apply(EK9Parser.AggregatePartsContext ctx) QuestionBlockGenerator.apply(ExprProcessingDetails details) RequireStmtGenerator.apply(EK9Parser.RequireStatementContext ctx) StatementOwnedCloseables.apply(org.antlr.v4.runtime.ParserRuleContext statementCtx, List<IRInstr> statement) The statement's (or initialiser's) instructions, wrapped so it closes the closeable temporaries it created - or unchanged when it creates none.StmtInstrGenerator.apply(EK9Parser.StatementContext ctx) Generate IR instructions for a statement using proper stack-based scope management.StreamStatementGenerator.apply(EK9Parser.StreamStatementContext ctx) SwitchStatementGenerator.apply(EK9Parser.SwitchStatementExpressionContext ctx) ThrowStatementGenerator.apply(EK9Parser.ThrowStatementContext ctx) TryCatchStatementGenerator.apply(EK9Parser.TryStatementExpressionContext ctx) UnaryOperationGenerator.apply(ExprProcessingDetails details) VariableDeclInstrGenerator.apply(EK9Parser.VariableDeclarationContext ctx) Generate IR instructions for variable declaration with assignment using stack-based scope management.VariableOnlyDeclInstrGenerator.apply(EK9Parser.VariableOnlyDeclarationContext ctx) Generate IR instructions for variable only declaration.WhileStatementGenerator.apply(EK9Parser.WhileStatementExpressionContext ctx) StreamStatementGenerator.applyExpression(EK9Parser.StreamExpressionContext ctx, String rhsExprResult) Generate IR for stream expression form:result <- cat items | stages | collect as Type.AbstractAssertExprGenerator.AssertBodyResult.bodyInstructions()Returns the value of thebodyInstructionsrecord component.StreamEmissionEngine.buildWindowRefill(IteratorSetup iteratorSetup, boolean isRawIterator, String submitItemVar, ISymbol elementType, String asyncExecutorVar, String inFlightVar, String oneVar, ISymbol integerType, List<EK9Parser.StreamPartContext> preAsyncStages, List<StageState> preAsyncStageStates, List<StageState.Counter> postHeads, org.ek9lang.compiler.phase7.generator.StreamEmissionEngine.AsyncCap cap, DebugInfo debugInfo) The windowed drain's REFILL step:if ([c1 < l1 AND ...] source.hasNext()) { bind submitItem = next(); [pre-async stages]; submit(submitItem); inFlight++ }.ResourceCloser.closeEach(List<ResourceCloser.Closing> closings, ResourceCloser.FirstFailure firstFailure, DebugInfo debugInfo) ResourceCloser.closingRegion(List, List, ResourceCloser.FirstFailure, DebugInfo)with no body: every value that is present closed, last first, each in its own protected region, then the first close failure rethrown with the later ones suppressed onto it.CloseChain.closeOperator(List<IRInstr> body, IAggregateSymbol aggregate, DebugInfo debugInfo) The body of a type's close followed, on every path, by its generated chain.ResourceCloser.closeRecording(ResourceCloser.Closing closing, ResourceCloser.FirstFailure firstFailure) ONE value, closed if present, in its own protected region that records an EK9 Exception intofirstFailure(the first) or suppresses it onto that (any later) - for a caller that holds the values itself and must do more between two closes (the application takes each registered component out of the registry, closes it and drops it:ApplicationClose).StreamPipelineMachinery.closeSource(CallDetails closeCall, DebugInfo debugInfo) THE close of a drained stream source (the async executor), in its pipeline's finally region.ResourceCloser.closingRegion(List<IRInstr> body, List<ResourceCloser.Closing> closings, ResourceCloser.FirstFailure firstFailure, DebugInfo debugInfo) THE owned region:body, then - on the normal path, after an EK9 Exception, and while a Panic unwinds - every value inclosingsthat is present is closed, last first, each in its own protected region; then the first EK9 Exception (the body's, else the first close's) is rethrown with the later close failures suppressed onto it.CloseChain.constructionFailure(List<IRInstr> body, IAggregateSymbol aggregate, DebugInfo debugInfo) A constructor's work after its construction call, with the chain run only if it fails.CloseChain.constructionFailureInOwnScope(List<IRInstr> body, IAggregateSymbol aggregate, DebugInfo debugInfo) CloseChain.constructionFailure(List, IAggregateSymbol, DebugInfo)in a scope of its own (SCOPE_ENTER/SCOPE_EXITaround it), so what the region registers has an entered scope to be released by: a generated constructor has no body scope, and a written one's region sits after its body scope has been left (or, after an explicitsuper(...), inside it).DeclarationParts.declaration()Returns the value of thedeclarationrecord component.StatementOwnedCloseables.OwnedTemporaries.declarations()Returns the value of thedeclarationsrecord component.WrittenParameters.declarations(EK9Parser.ArgumentParamContext argumentParam, GeneratorSet generators) The declarations of the written parameters, forOperationBodyPlan.parameters.OwnedDeclaration.declare(org.antlr.v4.runtime.ParserRuleContext owner, EK9Parser.VariableDeclarationContext variableDeclaration, EK9Parser.VariableOnlyDeclarationContext variableOnlyDeclaration) Declare whichever of the two forms is present; nothing when neither is.RangeIterationHelper.CaseConstructorParams.directionCheck()Returns the value of thedirectionCheckrecord component.<T extends ICanCaptureVariables & ISymbol>
List<IRInstr> DynamicConstructEmitter.emit(T dynamicSymbol, Function<IRGenerationContext, IRConstruct> generate, EK9Parser.DynamicVariableCaptureContext captureCtx, DebugInfo debugInfo, String resultVariable, Function<List<ISymbol>, CallMetaDataDetails> metaData) Emit the dynamic construct and the instructions that construct it.FunctionProbes.Registered.entryProbes()The probes that open the body, in order: coverage entry, then profiling entry.LoopGuardHelper.evaluatePreFlowSetupOnly(EK9Parser.PreFlowStatementContext preFlowStmt) Emit ONLY the preflow variable setup (declaration/assignment) with NO guard entry check.ResourceCloser.failureRegion(List<IRInstr> body, List<ResourceCloser.Closing> closings, ResourceCloser.FirstFailure firstFailure, DebugInfo debugInfo) The closes ofResourceCloser.closingRegion(List, List, ResourceCloser.FirstFailure, DebugInfo), run only whenbodyfails with an EK9 Exception - which is then rethrown with any close failure suppressed onto it.ResourceCloser.finallyRegion(List<IRInstr> body, Supplier<List<IRInstr>> finallyBuilder, DebugInfo debugInfo) body, thenfinallyBuilder's instructions on EVERY exit - its normal end, an EK9 Exception, a Panic, a cancelled async task'sCancelled- with nothing caught: a TRY_CATCH_FINALLY with no catch, in its own chain scope.AbstractStreamStageGenerator.gate(List<IRInstr> conditionInstructions, String conditionVar, String primitiveVar, List<IRInstr> bodyWhenTrue, List<IRInstr> bodyWhenFalse, DebugInfo debugInfo) THE conditional gate: runbodyWhenTruewhen the condition holds,bodyWhenFalseotherwise.ControlFlowChainGenerator.generateAssignIfUnset(ISymbol lhsSymbol, List<IRInstr> assignmentEvaluation, String assignmentResult, DebugInfo debugInfo) Generate SWITCH_CHAIN_BLOCK for assign-if-unset (:=?).ControlFlowChainGenerator.generateAssignIfUnsetTestForTemp(String variableName, ISymbol variableSymbol, String resultVariable, DebugInfo debugInfo) The question operator on a temp that holds the current value of a:=?target: a null there is the never-written slot:=?exists to write, so it is NOT a strict-absent observation (StrictAbsent).RangeIterationHelper.generateBodySetup(String loopVariableName, RangeIterationHelper.InitializationData initData, DebugInfo debugInfo) Generate body setup: loopVariable becomes a FRESH per-iteration value copied from the counter.ControlFlowChainGenerator.generateComparisonCoalescing(ExprProcessingDetails lhsDetails, ExprProcessingDetails rhsDetails, String comparisonOperator, String chainType) Generate CONTROL_FLOW_CHAIN for Comparison Coalescing operators (<?, >?).AbstractStreamStageGenerator.generateCounterDelta(String counterVar, String oneVar, String op, ISymbol integerType, DebugInfo debugInfo) ReassigncounterVar = counterVar <op> oneVar("_add"to increment,"_sub"to decrement) via the RELEASE/STORE/RETAIN reassignment pattern.StreamPipelineMachinery.generateDynamicStageLimit(EK9Parser.StreamPartContext stageCtx, String limitVar, ISymbol integerType, String scopeId, DebugInfo debugInfo) Generate IR to evaluate a dynamic stage operand (function reference or call) and store the Integer result in the given limit variable.ControlFlowChainGenerator.generateElvisCoalescing(ExprProcessingDetails lhsDetails, ExprProcessingDetails rhsDetails) Generate CONTROL_FLOW_CHAIN for Elvis Coalescing operator (:?).ControlFlowChainGenerator.generateExternalFieldAssignIfUnset(String isSetBoolean, List<IRInstr> assignmentBody, DebugInfo debugInfo) Generate CONTROL_FLOW_CHAIN for assign-if-unset on external field.StreamPipelineMachinery.generatePipelineItemBinding(String iteratorVar, IAggregateSymbol iteratorType, String pipelineItemVar, ISymbol elementType, DebugInfo debugInfo, boolean rawIterator) Generate: pipelineItem = iterator.next() Follows ForInGenerator.generateLoopVariableBinding() pattern.ControlFlowChainGenerator.generateQuestionOperator(ExprProcessingDetails exprDetails) Generate SWITCH_CHAIN_BLOCK for Question operator (?).ControlFlowChainGenerator.generateQuestionOperatorForTemp(String variableName, ISymbol variableSymbol, String resultVariable, DebugInfo debugInfo) Generate SWITCH_CHAIN_BLOCK for Question operator applied to a temp variable.ControlFlowChainGenerator.generateQuestionOperatorForVariable(ISymbol variableSymbol, String resultVariable, DebugInfo debugInfo) Generate SWITCH_CHAIN_BLOCK for Question operator applied to a variable.AbstractStreamStageGenerator.generateTerminalPipe(TerminalSetup terminalSetup, String pipelineItemVar, ISymbol elementType, DebugInfo debugInfo) THE shared "pipe a value into a sink" step:sink._pipe(value)- used by the pipeline terminal and bytee's side terminal.ControlFlowChainGenerator.generateTernary(ExprProcessingDetails details) Generate IR for ternary operator: condition <- thenValue : elseValue.AbstractVariableDeclGenerator.getDeclInstrs(org.antlr.v4.runtime.tree.ParseTree ctx, String owner) The declaration of a variable owned byowner- the declaring scope for a local, the CALLER for the returning variable (OwnershipStatements.declaredSlot(String, String, String, DebugInfo)).DeclarationParts.initialisation()Returns the value of theinitialisationrecord component.StageWrapParams.innerBody()Returns the value of theinnerBodyrecord component.BufferedStageParams.instructions()Returns the value of theinstructionsrecord component.ConditionStatementPrelude.Evaluated.instructions()Returns the value of theinstructionsrecord component.DrainCondition.instructions()Returns the value of theinstructionsrecord component.FreshBooleanOperand.instructions()Returns the value of theinstructionsrecord component.GuardedConditionEvaluator.ConditionEvaluation.instructions()Returns the value of theinstructionsrecord component.RangeIterationHelper.InitializationData.instructions()Returns the value of theinstructionsrecord component.StatementOwnedCloseables.OwnedEvaluation.instructions()Returns the value of theinstructionsrecord component.StatementOwnedCloseables.OwnedTemporaries.instructions()Returns the value of theinstructionsrecord component.SwitchCaseOrChainGenerator.ComparisonResult.instructions()Returns the value of theinstructionsrecord component.InterpolatedStringGenerator.interpolate(EK9Parser.StringLitContext stringLitCtx, VariableDetails resultDetails) THE interpolation entry point for callers that already hold a stringLit - use this, do not re-derive it.ResourceCloser.Closing.load()Returns the value of theloadrecord component.VariableOnlyDeclInstrGenerator.localDeclaration(EK9Parser.VariableOnlyDeclarationContext ctx) A LOCAL declared without a value (x as T?as a block statement): the declaration, then its owner - the declaring scope owns the slot's CURRENT value, so whatever a later:=/:=?leaves in it is released when that scope exits, normally and on unwind (A10, EK9_IR_OWNERSHIP_MODEL.md §6 and §12).RangeIterationHelper.CaseConstructorParams.loopBodySetup()Returns the value of theloopBodySetuprecord component.RangeIterationHelper.CaseConstructorParams.loopConditionTemplate()Returns the value of theloopConditionTemplaterecord component.RangeIterationHelper.CaseConstructorParams.loopIncrement()Returns the value of theloopIncrementrecord component.GuardedScopeOrchestrator.orchestrate(org.antlr.v4.runtime.tree.ParseTree ctx, EK9Parser.PreFlowStatementContext preFlowStmt, EK9Parser.ReturningParamContext returningParam, Function<GuardedScopeOrchestrator.OrchestratorContext, List<IRInstr>> coreGenerator) Orchestrate for constructs whose core producesList<IRInstr>.GuardedScopeOrchestrator.orchestrate(org.antlr.v4.runtime.tree.ParseTree ctx, EK9Parser.PreFlowStatementContext preFlowStmt, EK9Parser.ReturningParamContext returningParam, Function<GuardedScopeOrchestrator.OrchestratorContext, List<IRInstr>> coreGenerator, boolean coreManagesReturnSetup) Orchestrate with control over return-variable setup placement.GuardedScopeOrchestrator.orchestrateChain(org.antlr.v4.runtime.tree.ParseTree ctx, EK9Parser.PreFlowStatementContext preFlowStmt, EK9Parser.ReturningParamContext returningParam, Function<GuardedScopeOrchestrator.OrchestratorContext, ControlFlowChainDetails> coreGenerator) Orchestrate for constructs whose core producesControlFlowChainDetails.ConditionAndPostLoop.postLoopInstructions()Returns the value of thepostLoopInstructionsrecord component.StageWrapResult.postLoopInstructions()Returns the value of thepostLoopInstructionsrecord component.GuardedConditionEvaluator.preFlowSetup(EK9Parser.PreFlowStatementContext preFlowStmt) THE emission of a pre-flow's setup (FLOW-1): the declaration ofv <- e()or the assignment ofv := e()/v :=? e(), registered in the CURRENT stack scope.StageSetupResult.preLoopInstructions()Returns the value of thepreLoopInstructionsrecord component.AbstractGenerator.processBlockStatements(EK9Parser.BlockContext ctx, Function<EK9Parser.BlockStatementContext, List<IRInstr>> blockStmtGenerator) Process all block statements from a BlockContext by unwrapping to InstructionBlockContext.AbstractGenerator.processBlockStatements(EK9Parser.InstructionBlockContext ctx, Function<EK9Parser.BlockStatementContext, List<IRInstr>> blockStmtGenerator) Process all block statements in an instruction block.BinaryOperationGenerator.processOperandExpression(EK9Parser.ExpressionContext operandExpr, VariableDetails operandDetails) Process operand expression using exprGenerator from generators struct.UnaryOperationGenerator.processOperandExpression(EK9Parser.ExpressionContext operandExpr, VariableDetails operandDetails) Process operand expression using exprGenerator from generators struct.ApplicationClose.rethrow(ResourceCloser.FirstFailure firstFailure, DebugInfo debugInfo) After every registration has been closed and dropped: rethrow the first close failure, if any.ResourceCloser.rethrow(ResourceCloser.FirstFailure firstFailure, DebugInfo debugInfo) After a caller's own sequence ofResourceCloser.closeRecording(ResourceCloser.Closing, ResourceCloser.FirstFailure):THROW firstFailurewhen one was recorded.CallStageWrapper.wrap(StageWrapParams params, String inVar, String outVar) FilterRejectStageWrapper.wrap(StageWrapParams params, String pipelineItemVar, ISymbol elementType) FlattenStageWrapper.wrap(StageWrapParams params, String inVar, String outVar) FlattenStageWrapper.wrap(StageWrapParams params, String inVar, String outVar, List<StageState.Counter> downstreamHeads) Wrap with the inner loop bounded bydownstreamHeads: the heads after this flatten (up to the next drain).FlattenStageWrapper.wrap(StageWrapParams params, Supplier<List<IRInstr>> downstream, String inVar, String outVar, List<StageState.Counter> downstreamHeads) Wrap with the downstream body GENERATED inside this flatten's per-element body scope:downstreamis called once that scope is current, so whatever the downstream stages register (a head's comparison, a map's result) is owned by the inner loop's body and released every inner iteration - not by a scope entered once around the whole loop, which would release only the last element's (A11; EK9_IR_OWNERSHIP_MODEL.md §7).FunctionProbes.wrap(List<IRInstr> body, FunctionProbes.Registered probes, IRInstr beforeReturn) A body generated without probes, instrumented afterwards: the entry probes first, then the body, withbeforeReturn(if any) and then the profiling exit before every top-levelRETURN.HeadSkipStageWrapper.wrap(StageWrapParams params, StageState stageState, String asyncExecutorVar) JoinStageWrapper.wrap(StageWrapParams params, String pipelineItemVar, StageState stageState, List<IRInstr> postLoopInstructions) JoinStageWrapper.wrap(StageWrapParams params, Supplier<List<IRInstr>> downstream, String pipelineItemVar, StageState stageState, List<IRInstr> postLoopInstructions) Wrap with the downstream body GENERATED inside the post-loop emit's own scope:downstreamis called once that scope is current, so what the downstream stages register is owned by a scope open where they run.MapStageWrapper.wrap(StageWrapParams params, String inVar, String outVar) StreamElementStageWrapper.wrap(StageWrapParams params, String pipelineItemVar, ISymbol elementType) WrapinnerBodyin this stage's gate or side effect.StreamPostLoopStageWrapper.wrap(StageWrapParams params, String pipelineItemVar, StageState stageState, List<IRInstr> postLoopInstructions) WrapinnerBodysuch that it runs after the loop rather than during it.StreamStageWrapper.wrap(StageWrapParams params, String inVar, String outVar) WrapinnerBodyin this stage's transformation.TailStageWrapper.wrap(StageWrapParams params, String pipelineItemVar, StageState stageState, List<IRInstr> postLoopInstructions) TailStageWrapper.wrap(StageWrapParams params, Supplier<List<IRInstr>> downstream, String pipelineItemVar, StageState stageState, List<IRInstr> postLoopInstructions) Wrap with the downstream body GENERATED inside the drain loop's per-element body scope:downstreamis called once that scope is current, so what the downstream stages register is owned by the drain's iteration, not by a scope entered once around the pipeline (A11; EK9_IR_OWNERSHIP_MODEL.md §7).TeeStageWrapper.wrap(StageWrapParams params, String pipelineItemVar, ISymbol elementType, StageState teeState) WrapinnerBody: pipe the item (or its mapped value) to the side target, then run the inner body.UniqStageWrapper.wrap(StageWrapParams params, String pipelineItemVar, ISymbol elementType, StageState stageState) LoopGuardHelper.wrapBodyWithGuardEntryCheck(GuardVariableDetails guardDetails, List<IRInstr> bodyInstructions, String guardScopeId, DebugInfo debugInfo) Wrap body instructions in an IF_ELSE_IF that checks the guard entry condition.LoopGuardHelper.wrapChainWithGuardEntryCheck(GuardVariableDetails guardDetails, ControlFlowChainDetails chainDetails, String guardScopeId, DebugInfo debugInfo) Wrap a ControlFlowChainDetails (loop or try) in an IF_ELSE_IF that checks the guard entry condition.LoopGuardHelper.wrapExpressionFormWithGuardEntryCheck(GuardVariableDetails guardDetails, List<IRInstr> returnVariableSetup, List<IRInstr> bodyInstructionsWithoutRtn, String guardScopeId, DebugInfo debugInfo) Wrap body instructions in an IF_ELSE_IF for EXPRESSION FORM with return variable.StageWrapResult.wrappedBody()Returns the value of thewrappedBodyrecord component.Methods in org.ek9lang.compiler.phase7.generator with parameters of type IRInstrModifier and TypeMethodDescriptionprotected voidAbstractStreamStageGenerator.addManagedCall(List<IRInstr> target, IRInstr callInstr, String resultVar, DebugInfo debugInfo) protected voidAbstractStreamStageGenerator.publishCallResultAndContinue(List<IRInstr> target, String outVar, IRInstr callInstr, List<IRInstr> innerBody, DebugInfo debugInfo) AbstractStreamStageGenerator.publishAndContinue(List, String, String, List, DebugInfo)for a stage value made by a call here (map,call): moved into the out-variable (AbstractStreamStageGenerator.rebindToCallResult(List, String, IRInstr, DebugInfo)), then the inner body.protected voidAbstractStreamStageGenerator.rebindToCallResult(List<IRInstr> target, String slot, IRInstr callInstr, DebugInfo debugInfo) THE move of a call's result, made here, into a slot: the call, thenSLOT_ASSIGN slot, result [consume]- the slot takes the call's count, and nothing else owns the result (OwnershipStatements.reboundFresh(String, String, DebugInfo); the harness rule move-into-slot).protected voidAbstractStreamStageGenerator.rebindToCastCallResult(List<IRInstr> target, String slot, IRInstr callInstr, String castTypeName, DebugInfo debugInfo) THE move of a call's result, cast to the element type, into a slot: a raw source'snext()hands backAnyat +1, the CAST takes that count (V-D) andSLOT_ASSIGN slot, cast [consume]moves it in (OwnershipStatements.reboundFresh(String, String, DebugInfo); harness rule move-into-slot).FunctionProbes.wrap(List<IRInstr> body, FunctionProbes.Registered probes, IRInstr beforeReturn) A body generated without probes, instrumented afterwards: the entry probes first, then the body, withbeforeReturn(if any) and then the profiling exit before every top-levelRETURN.Method parameters in org.ek9lang.compiler.phase7.generator with type arguments of type IRInstrModifier and TypeMethodDescriptionvoidOperationDfnGenerator.accept(OperationInstr operation, EK9Parser.OperationDetailsContext ctx, List<IRInstr> beforeInstanceInit) OperationDfnGenerator.accept(OperationInstr, EK9Parser.OperationDetailsContext), withbeforeInstanceInit- THE capture stores of a dynamic class's explicit capture constructor (CaptureStores,support/IsCaptureConstructor) - placed while the body is built: just after the constructor's super(...) call, implicit or explicit, or first when it has none or delegates with this(...) - so before every_i_initit runs and outside the partial-construction region (D10).voidOperationDfnGenerator.acceptInMethodFrame(OperationInstr operation, EK9Parser.OperationDetailsContext ctx, List<IRInstr> beforeInstanceInit) OperationDfnGenerator.acceptInMethodFrame(OperationInstr, EK9Parser.OperationDetailsContext)for a dynamic class's explicit capture constructor, with its capture stores (OperationDfnGenerator.accept(OperationInstr, EK9Parser.OperationDetailsContext, List)).protected voidAbstractGenerator.addCoverageProbe(org.antlr.v4.runtime.tree.ParseTree ctx, List<IRInstr> instructions, Function<DebugInfo, IRInstr> probeFactory) Add a coverage probe instruction if coverage instrumentation is enabled.protected voidAbstractGenerator.addCoverageProbe(org.antlr.v4.runtime.tree.ParseTree ctx, List<IRInstr> instructions, Function<DebugInfo, IRInstr> probeFactory) Add a coverage probe instruction if coverage instrumentation is enabled.protected voidAbstractStreamStageGenerator.addManagedCall(List<IRInstr> target, IRInstr callInstr, String resultVar, DebugInfo debugInfo) (package private) StringStreamDemand.appendBoundedCondition(List<IRInstr> conditionEvaluation, List<IRInstr> leftInstructions, String leftResult, String leftPrimitive, List<IRInstr> rightInstructions, String rightResult, String scopeId, DebugInfo debugInfo) Append a short-circuitLEFT AND RIGHTBoolean condition toconditionEvaluationand return the combined Boolean result variable.(package private) StringStreamDemand.appendDemandCondition(List<IRInstr> conditionEvaluation, List<StageState.Counter> bounds, List<IRInstr> rightInstructions, String rightResult, String scopeId, DebugInfo debugInfo) Append the demand-bounded conditionc1 < l1 AND (... AND right)toconditionEvaluationand return its Boolean result.(package private) StringStreamDemand.appendDemandOverPrimitive(List<IRInstr> condition, List<StageState.Counter> heads, List<IRInstr> primitiveInstructions, String primitiveResult, String scopeId, DebugInfo debugInfo) Gate a loop whose continuation is a runtime helper's PRIMITIVEhasNext-style call (Ek9Group.hasNextGroup,Ek9Async.hasNext): with no heads the condition is unchanged; otherwise the primitive is lifted to a Boolean (Boolean._of) so it can be the right operand of the demand AND.FunctionCallProcessor.apply(CallProcessingDetails details, Function<ExprProcessingDetails, List<IRInstr>> exprProcessor) Apply function call processing with an expression processor function.StatementOwnedCloseables.apply(org.antlr.v4.runtime.ParserRuleContext statementCtx, List<IRInstr> statement) The statement's (or initialiser's) instructions, wrapped so it closes the closeable temporaries it created - or unchanged when it creates none.(package private) voidStreamEmissionEngine.applyGroupingStage(StreamSource source, ISymbol consumedElementType, BucketTracker tracker, StageGroup preStageGroup, StageGroup postStageGroup, BoundaryConditionBuilder boundaryBuilder, TerminalSetup terminalSetup, org.antlr.v4.runtime.tree.ParseTree probeSite, List<IRInstr> instructions, DebugInfo debugInfo) Shared drain+emit engine for the consecutive-grouping stream stages (GROUP, SPLIT).protected voidAbstractStreamStageGenerator.borrowedBy(List<IRInstr> target, String value, String scopeId, DebugInfo debugInfo) THE stream statement thatscopeIdkeeps a value that arrived borrowed (+0: a LOAD, a CAST, a function instance) alive -OWN; DROP_AT_EXIT(OwnershipStatements.borrowInScope(String, String, DebugInfo)).CloseChain.closeOperator(List<IRInstr> body, IAggregateSymbol aggregate, DebugInfo debugInfo) The body of a type's close followed, on every path, by its generated chain.ResourceCloser.closingRegion(List<IRInstr> body, List<ResourceCloser.Closing> closings, ResourceCloser.FirstFailure firstFailure, DebugInfo debugInfo) THE owned region:body, then - on the normal path, after an EK9 Exception, and while a Panic unwinds - every value inclosingsthat is present is closed, last first, each in its own protected region; then the first EK9 Exception (the body's, else the first close's) is rethrown with the later close failures suppressed onto it.CloseChain.constructionFailure(List<IRInstr> body, IAggregateSymbol aggregate, DebugInfo debugInfo) A constructor's work after its construction call, with the chain run only if it fails.CloseChain.constructionFailureInOwnScope(List<IRInstr> body, IAggregateSymbol aggregate, DebugInfo debugInfo) CloseChain.constructionFailure(List, IAggregateSymbol, DebugInfo)in a scope of its own (SCOPE_ENTER/SCOPE_EXITaround it), so what the region registers has an entered scope to be released by: a generated constructor has no body scope, and a written one's region sits after its body scope has been left (or, after an explicitsuper(...), inside it).(package private) voidStreamEmissionEngine.continueOverIterator(List<EK9Parser.StreamPartContext> stages, IteratorSetup sourceIter, ISymbol sourceElementType, Function<List<IRInstr>, TerminalSetup> terminalResolver, boolean sourceUnbounded, org.antlr.v4.runtime.tree.ParseTree probeSite, DebugInfo debugInfo, List<IRInstr> instructions) THE pipeline driver over a source iterator: emit a stream given assourceIterthroughstagesto the terminal, with NO composition limit.(package private) StringStreamPipelineMachinery.declareElementSlot(List<IRInstr> target, boolean typed, String typeName, String scopeId, DebugInfo debugInfo) THE declaration of a pipeline's flowing ELEMENT slot - rebound every element (a source item, an emitted item, a drained bucket item, a current group): a compiler-made slot the declaring scope owns, which drops its LAST value at exit and on unwind (A10; EK9_IR_OWNERSHIP_MODEL.md §6), so nothing releases it after the loop.(package private) StringStreamPipelineMachinery.declareInitialisedSlot(List<IRInstr> target, ISymbol type, String literal, DebugInfo debugInfo) THE declaration of a compiler-made, initialised SLOT - a counter or flag rebound as the pipeline runs (a head or skip counter, the async in-flight and submitted counts, the windowed-asyncmoreflag):REFERENCE,STOREof the initial value,RETAIN, then the slot registered in the current scope, which releases its LAST value on exit and on unwind (A10; EK9_IR_OWNERSHIP_MODEL.md §6).(package private) voidStreamPipelineMachinery.declareOwnedSlot(List<IRInstr> target, boolean typed, String slot, String typeName, String scopeId, DebugInfo debugInfo) StreamPipelineMachinery.declareElementSlot(List, boolean, String, String, DebugInfo)for a slot that already has its name - a stream's ownforloop variable.(package private) voidStreamPipelineMachinery.drainNextIntoItem(List<IRInstr> body, HelperSource source, String castTypeName, String drainItemVar, DebugInfo debugInfo) THE drain-loop body preamble:raw = source.next()(typedAny), cast to the element type, then bound into the persistent drain item variable.(package private) IteratorSetupStreamPipelineMachinery.drainSourceToIterator(HelperSource source, ISymbol bucketType, boolean keepsUnset, DebugInfo debugInfo, List<IRInstr> instructions) As above;keepsUnsetappends with+=so an UNSET element survives the buffer - a stage never drops one (KeepsUnsetElements).(package private) IteratorSetupStreamPipelineMachinery.drainSourceToIterator(HelperSource source, ISymbol bucketType, DebugInfo debugInfo, List<IRInstr> instructions) MATERIALISE a buffering value source (a GROUP/SPLIT tracker's hasNextGroup/nextGroup, or an async executor's hasNext/next) into a fresh raw EK9_LIST buffer and return an IteratorSetup over it.protected StringAbstractStreamStageGenerator.emitStageFunctionOperand(List<IRInstr> target, EK9Parser.PipelinePartContext pipelinePartCtx, ISymbol operandSymbol, FunctionSymbol functionType, DebugInfo debugInfo) THE shared emission of a stream stage's function operand - use this, do not re-derive it.(package private) voidStreamPipelineMachinery.emitStreamLoop(ConditionAndPostLoop loop, String loopScopeId, DebugInfo debugInfo, List<IRInstr> instructions) THE emission of a built stream loop: its while (StreamPipelineMachinery.emitWhileLoop(ConditionCaseDetails, String, DebugInfo, List)) then its post-loop instructions (a stage that emits after the loop - tail's drain, join's result).(package private) voidStreamPipelineMachinery.emitWhileLoop(ConditionCaseDetails conditionCase, String loopScopeId, DebugInfo debugInfo, List<IRInstr> instructions) THE while loop of a stream loop:conditionCaseas a WHILE overloopScopeId, appended toinstructions.(package private) StringIterationSourceLowering.enumInstanceForIteration(IAggregateSymbol enumType, DebugInfo debugInfo, List<IRInstr> instructions) An unset instance of an enumeration type, made by its default constructor, in a fresh managed temp.CallArguments.evaluate(EK9Parser.ParamExpressionContext paramExpression, CallArguments.DebugInfoPolicy debugInfoPolicy, Function<ExprProcessingDetails, List<IRInstr>> exprProcessor, List<IRInstr> instructions) Evaluate every argument of the parameter expression (which may be null) into the instructions.CallArguments.evaluate(EK9Parser.ParamExpressionContext paramExpression, CallArguments.DebugInfoPolicy debugInfoPolicy, Function<ExprProcessingDetails, List<IRInstr>> exprProcessor, List<IRInstr> instructions) Evaluate every argument of the parameter expression (which may be null) into the instructions.protected StringAbstractStreamStageGenerator.evaluateExpressionOperand(EK9Parser.PipelinePartContext pipelinePartCtx, List<IRInstr> target, DebugInfo debugInfo) THE evaluation of a stream operand written as an EXPRESSION - anobjectAccessExpressionor acall- into a fresh, managed (RETAIN + SCOPE_REGISTER) temp.protected StringAbstractStreamStageGenerator.extractPrimitive(List<IRInstr> target, String booleanVar, DebugInfo debugInfo) THE Boolean-to-primitive extraction: mint a temp and append the_true()call that yields a JVM primitive / LLVM i8 the branch instructions can test directly.ResourceCloser.failureRegion(List<IRInstr> body, List<ResourceCloser.Closing> closings, ResourceCloser.FirstFailure firstFailure, DebugInfo debugInfo) The closes ofResourceCloser.closingRegion(List, List, ResourceCloser.FirstFailure, DebugInfo), run only whenbodyfails with an EK9 Exception - which is then rethrown with any close failure suppressed onto it.ResourceCloser.finallyRegion(List<IRInstr> body, Supplier<List<IRInstr>> finallyBuilder, DebugInfo debugInfo) body, thenfinallyBuilder's instructions on EVERY exit - its normal end, an EK9 Exception, a Panic, a cancelled async task'sCancelled- with nothing caught: a TRY_CATCH_FINALLY with no catch, in its own chain scope.ResourceCloser.finallyRegion(List<IRInstr> body, Supplier<List<IRInstr>> finallyBuilder, DebugInfo debugInfo) body, thenfinallyBuilder's instructions on EVERY exit - its normal end, an EK9 Exception, a Panic, a cancelled async task'sCancelled- with nothing caught: a TRY_CATCH_FINALLY with no catch, in its own chain scope.AbstractStreamStageGenerator.gate(List<IRInstr> conditionInstructions, String conditionVar, String primitiveVar, List<IRInstr> bodyWhenTrue, List<IRInstr> bodyWhenFalse, DebugInfo debugInfo) THE conditional gate: runbodyWhenTruewhen the condition holds,bodyWhenFalseotherwise.ControlFlowChainGenerator.generateAssignIfUnset(ISymbol lhsSymbol, List<IRInstr> assignmentEvaluation, String assignmentResult, DebugInfo debugInfo) Generate SWITCH_CHAIN_BLOCK for assign-if-unset (:=?).ControlFlowChainGenerator.generateExternalFieldAssignIfUnset(String isSetBoolean, List<IRInstr> assignmentBody, DebugInfo debugInfo) Generate CONTROL_FLOW_CHAIN for assign-if-unset on external field.booleanStatementOwnedCloseables.involvesCloseables(List<IRInstr> evaluation, ISymbol resultType) True whenStatementOwnedCloseables.ownedEvaluation(ParserRuleContext, List, String, ISymbol)could do anything to this evaluation: its value is closeable, or it makes a closeable temporary phase 5 marked as owned, or it holds one deferred to it.(package private) StringIterationSourceLowering.iteratorOf(IAggregateSymbol sourceType, String sourceVar, IAggregateSymbol iteratorType, DebugInfo debugInfo, List<IRInstr> instructions) sourceVar.iterator()into a fresh managed temp, typediteratorType.protected StringAbstractStreamStageGenerator.loadManagedLiteral(List<IRInstr> target, String value, ISymbol type, DebugInfo debugInfo) THE load of a compiler-made literal ("0","1", a fixed head/tail limit,"true") into a fresh managed temp - mints the temp, then the managed literal load.static OperationBodyPlan.StepA part that is a list made when the part is reached.GuardedScopeOrchestrator.orchestrate(org.antlr.v4.runtime.tree.ParseTree ctx, EK9Parser.PreFlowStatementContext preFlowStmt, EK9Parser.ReturningParamContext returningParam, Function<GuardedScopeOrchestrator.OrchestratorContext, List<IRInstr>> coreGenerator) Orchestrate for constructs whose core producesList<IRInstr>.GuardedScopeOrchestrator.orchestrate(org.antlr.v4.runtime.tree.ParseTree ctx, EK9Parser.PreFlowStatementContext preFlowStmt, EK9Parser.ReturningParamContext returningParam, Function<GuardedScopeOrchestrator.OrchestratorContext, List<IRInstr>> coreGenerator, boolean coreManagesReturnSetup) Orchestrate with control over return-variable setup placement.The closeable temporaries these instructions make that phase 5 marked as owned: the owner declarations (emit them before the region that closes them), the same instructions with each temporary handed over to its owner right after the call that made it, and oneResourceCloser.Closingper owner, in the order the temporaries are made.protected voidAbstractStreamStageGenerator.ownedBy(List<IRInstr> target, String value, String scopeId, DebugInfo debugInfo) THE stream statement thatscopeIdowns a value just made (+1) here -DROP_AT_EXIT(OwnershipStatements.droppedAtExit(String, String, DebugInfo)).StatementOwnedCloseables.ownedEvaluation(org.antlr.v4.runtime.ParserRuleContext ctx, List<IRInstr> evaluation, String resultVariable, ISymbol resultType) An evaluation nested inside another instruction (a condition, a control, an operand) that hands ONE value on: the evaluation wrapped, like a statement, in THE owned region that closes the closeable temporaries it made - and the variable that now holds its value after the region.AbstractGenerator.processBlockStatements(EK9Parser.BlockContext ctx, Function<EK9Parser.BlockStatementContext, List<IRInstr>> blockStmtGenerator) Process all block statements from a BlockContext by unwrapping to InstructionBlockContext.AbstractGenerator.processBlockStatements(EK9Parser.InstructionBlockContext ctx, Function<EK9Parser.BlockStatementContext, List<IRInstr>> blockStmtGenerator) Process all block statements in an instruction block.ConstructorCallProcessor.processChainStart(CallSymbol callSymbol, EK9Parser.CallContext callContext, String resultVariable, List<IRInstr> instructions) THE constructor call that STARTS an object-access chain -String(move).upperCase(),Holder(3).amount(),SomeText("en").message().voidConstructorCallProcessor.processConstructorCall(CallSymbol callSymbol, EK9Parser.CallContext callContext, String resultVariable, List<IRInstr> instructions) Process a constructor call that creates a new object and generate appropriate IR instructions - the owner is the (resolved) type of the constructor itself.voidConstructorCallProcessor.processDelegatingConstructorCall(CallSymbol callSymbol, EK9Parser.CallContext callContext, String resultVariable, String thisOrSuper, List<IRInstr> instructions) Process a delegating constructor call -this(...)orsuper(...)- whose target object is the receiver being constructed.protected voidAbstractStreamStageGenerator.publishAndContinue(List<IRInstr> target, String outVar, String producedVar, List<IRInstr> innerBody, DebugInfo debugInfo) Publish a stage's produced value into the flowing out-variable: RELEASE old, STORE new, RETAIN new, then run the inner body (the terminal, or the next stage downstream).protected voidAbstractStreamStageGenerator.publishCallResultAndContinue(List<IRInstr> target, String outVar, IRInstr callInstr, List<IRInstr> innerBody, DebugInfo debugInfo) AbstractStreamStageGenerator.publishAndContinue(List, String, String, List, DebugInfo)for a stage value made by a call here (map,call): moved into the out-variable (AbstractStreamStageGenerator.rebindToCallResult(List, String, IRInstr, DebugInfo)), then the inner body.(package private) IteratorSetupStreamPipelineMachinery.rawListIterator(String bufferVar, DebugInfo debugInfo, List<IRInstr> instructions) THE iterator over a stream's raworg.ek9.lang::Listbuffer:buffer.iterator()into a fresh managed temp, typed as the rawIteratorover the rawList- so the loops that read it cast eachnext()(anAny) to the element type.protected voidAbstractStreamStageGenerator.rebind(List<IRInstr> target, String variable, String sourceVar, DebugInfo debugInfo) THE alloca-backed variable reassignment: RELEASE the old value, STORE the new one, RETAIN it.protected voidAbstractStreamStageGenerator.rebindToCallResult(List<IRInstr> target, String slot, IRInstr callInstr, DebugInfo debugInfo) THE move of a call's result, made here, into a slot: the call, thenSLOT_ASSIGN slot, result [consume]- the slot takes the call's count, and nothing else owns the result (OwnershipStatements.reboundFresh(String, String, DebugInfo); the harness rule move-into-slot).protected voidAbstractStreamStageGenerator.rebindToCastCallResult(List<IRInstr> target, String slot, IRInstr callInstr, String castTypeName, DebugInfo debugInfo) THE move of a call's result, cast to the element type, into a slot: a raw source'snext()hands backAnyat +1, the CAST takes that count (V-D) andSLOT_ASSIGN slot, cast [consume]moves it in (OwnershipStatements.reboundFresh(String, String, DebugInfo); harness rule move-into-slot).(package private) ObjectAccessInstrGenerator.ChainStepResultObjectAccessInstrGenerator.receiverOfFinalStep(EK9Parser.ObjectAccessExpressionContext ctx, List<IRInstr> instructions) THE receiver of a chain's FINAL step -getHolder()ingetHolder().name,keeper.holder()inkeeper.holder().name- evaluated into a temp by exactly the lowering the read side uses for the same chain (start, calls and property loads, with their ARC), so an assignment target that reaches its field through a call cannot lower the call differently from a read of it.(package private) IteratorSetupStreamPipelineMachinery.sortBufferAndGetIterator(EK9Parser.StreamPartContext sortStage, String bufferVar, DebugInfo debugInfo, List<IRInstr> instructions) Sort a raw org.ek9.lang::List buffer in place and return an iterator over the sorted result.(package private) StringIterationSourceLowering.sourceValue(EK9Parser.ExpressionContext sourceCtx, IAggregateSymbol sourceType, DebugInfo debugInfo, List<IRInstr> instructions) The source's value in a fresh managed temp: the enumeration instance (IterationSourceLowering.enumInstanceForIteration(IAggregateSymbol, DebugInfo, List)) or the evaluated expression.FlattenStageWrapper.wrap(StageWrapParams params, Supplier<List<IRInstr>> downstream, String inVar, String outVar, List<StageState.Counter> downstreamHeads) Wrap with the downstream body GENERATED inside this flatten's per-element body scope:downstreamis called once that scope is current, so whatever the downstream stages register (a head's comparison, a map's result) is owned by the inner loop's body and released every inner iteration - not by a scope entered once around the whole loop, which would release only the last element's (A11; EK9_IR_OWNERSHIP_MODEL.md §7).FunctionProbes.wrap(List<IRInstr> body, FunctionProbes.Registered probes, IRInstr beforeReturn) A body generated without probes, instrumented afterwards: the entry probes first, then the body, withbeforeReturn(if any) and then the profiling exit before every top-levelRETURN.JoinStageWrapper.wrap(StageWrapParams params, String pipelineItemVar, StageState stageState, List<IRInstr> postLoopInstructions) JoinStageWrapper.wrap(StageWrapParams params, Supplier<List<IRInstr>> downstream, String pipelineItemVar, StageState stageState, List<IRInstr> postLoopInstructions) Wrap with the downstream body GENERATED inside the post-loop emit's own scope:downstreamis called once that scope is current, so what the downstream stages register is owned by a scope open where they run.JoinStageWrapper.wrap(StageWrapParams params, Supplier<List<IRInstr>> downstream, String pipelineItemVar, StageState stageState, List<IRInstr> postLoopInstructions) Wrap with the downstream body GENERATED inside the post-loop emit's own scope:downstreamis called once that scope is current, so what the downstream stages register is owned by a scope open where they run.StreamPostLoopStageWrapper.wrap(StageWrapParams params, String pipelineItemVar, StageState stageState, List<IRInstr> postLoopInstructions) WrapinnerBodysuch that it runs after the loop rather than during it.TailStageWrapper.wrap(StageWrapParams params, String pipelineItemVar, StageState stageState, List<IRInstr> postLoopInstructions) TailStageWrapper.wrap(StageWrapParams params, Supplier<List<IRInstr>> downstream, String pipelineItemVar, StageState stageState, List<IRInstr> postLoopInstructions) Wrap with the downstream body GENERATED inside the drain loop's per-element body scope:downstreamis called once that scope is current, so what the downstream stages register is owned by the drain's iteration, not by a scope entered once around the pipeline (A11; EK9_IR_OWNERSHIP_MODEL.md §7).TailStageWrapper.wrap(StageWrapParams params, Supplier<List<IRInstr>> downstream, String pipelineItemVar, StageState stageState, List<IRInstr> postLoopInstructions) Wrap with the downstream body GENERATED inside the drain loop's per-element body scope:downstreamis called once that scope is current, so what the downstream stages register is owned by the drain's iteration, not by a scope entered once around the pipeline (A11; EK9_IR_OWNERSHIP_MODEL.md §7).LoopGuardHelper.wrapBodyWithGuardEntryCheck(GuardVariableDetails guardDetails, List<IRInstr> bodyInstructions, String guardScopeId, DebugInfo debugInfo) Wrap body instructions in an IF_ELSE_IF that checks the guard entry condition.LoopGuardHelper.wrapExpressionFormWithGuardEntryCheck(GuardVariableDetails guardDetails, List<IRInstr> returnVariableSetup, List<IRInstr> bodyInstructionsWithoutRtn, String guardScopeId, DebugInfo debugInfo) Wrap body instructions in an IF_ELSE_IF for EXPRESSION FORM with return variable.(package private) StageWrapResultStreamStageDispatcher.wrapWithStages(List<EK9Parser.StreamPartContext> stages, Supplier<List<IRInstr>> innerBody, String pipelineItemVar, ISymbol elementType, DebugInfo debugInfo, List<StageState> stageStates) Wrap an innermost body with intermediate pipeline stages in reverse order.(package private) StageWrapResultStreamStageDispatcher.wrapWithStages(List<EK9Parser.StreamPartContext> stages, Supplier<List<IRInstr>> innerBody, String pipelineItemVar, ISymbol elementType, DebugInfo debugInfo, List<StageState> stageStates, String asyncExecutorVar) Wrap inner body instructions with intermediate pipeline stages in reverse order.(package private) StageWrapResultStreamStageDispatcher.wrapWithStages(List<EK9Parser.StreamPartContext> stages, Supplier<List<IRInstr>> innerBody, String pipelineItemVar, ISymbol elementType, DebugInfo debugInfo, List<StageState> stageStates, String asyncExecutorVar, PipelineVarPlan plan) Core stage-wrapping with an explicit per-boundaryPipelineVarPlan.(package private) StageWrapResultStreamStageDispatcher.wrapWithStages(List<EK9Parser.StreamPartContext> stages, Supplier<List<IRInstr>> innerBody, List<StageState> stageStates, String asyncExecutorVar, PipelineVarPlan plan) Core stage-wrapping over an innermost body that is GENERATED on demand:innerBodyis called where the body is placed, so when aflattenortailopens a loop around it, what it registers is owned by that loop's iteration (A11).Constructors in org.ek9lang.compiler.phase7.generator with parameters of type IRInstrModifierConstructorDescriptionRegistered(IRInstr coverageEntry, IRInstr profilingEntry, IRInstr profilingExit) Creates an instance of aRegisteredrecord class.Constructor parameters in org.ek9lang.compiler.phase7.generator with type arguments of type IRInstrModifierConstructorDescription(package private)AbstractShortCircuitGenerator(IRGenerationContext stackContext, VariableMemoryManagement variableMemoryManagement, RecordExprProcessing recordExprProcessing, Function<LogicalDetails, IRInstr> logicalOperation, Supplier<StatementOwnedCloseables> ownedCloseables) protectedAssertBodyResult(List<IRInstr> bodyInstructions, String scopeId, String expressionText) Creates an instance of aAssertBodyResultrecord class.(package private)BufferedStageParams(StageGroup stageGroup, StreamSource source, TerminalSetup terminalSetup, List<IRInstr> instructions, DebugInfo debugInfo, org.antlr.v4.runtime.tree.ParseTree probeSite) Creates an instance of aBufferedStageParamsrecord class.(package private)CaseConstructorParams(List<IRInstr> directionCheck, String directionPrimitive, List<IRInstr> loopConditionTemplate, String loopConditionPrimitive, List<IRInstr> loopBodySetup, ForRangePolymorphicInstr.ValueGuard valueGuard, ForRangePolymorphicInstr.EndCheck endCheck, List<IRInstr> loopIncrement, ForRangePolymorphicInstr.ProgressCheck progressCheck) Creates an instance of aCaseConstructorParamsrecord class.Closing(List<IRInstr> load, String variable, ISymbol staticType, String staticTypeName, DebugInfo debugInfo) A value brought into a variable byload(a property's LOAD_FIELD).Closing(List<IRInstr> load, String variable, ISymbol staticType, String staticTypeName, DebugInfo debugInfo, boolean viaSuper) Creates an instance of aClosingrecord class.ComparisonResult(List<IRInstr> instructions, String resultVariable, String primitiveCondition) Creates an instance of aComparisonResultrecord class.(package private)ConditionAndPostLoop(ConditionCaseDetails conditionCase, List<IRInstr> postLoopInstructions) Creates an instance of aConditionAndPostLooprecord class.ConditionEvaluation(List<IRInstr> instructions, String primitiveCondition) Creates an instance of aConditionEvaluationrecord class.ConstructorCallProcessor(IRGenerationContext stackContext, CallArguments callArguments, ParameterPromotionProcessor parameterPromotionProcessor, Function<ExprProcessingDetails, List<IRInstr>> expressionProcessor) ControlFlowChainGenerator(IRGenerationContext stackContext, VariableMemoryManagement variableMemoryManagement, SynthesisedCallMetaData synthesisedCallMetaData, Function<ExprProcessingDetails, List<IRInstr>> rawExprProcessor, Supplier<StatementOwnedCloseables> ownedCloseables) DeclarationParts(List<IRInstr> declaration, List<IRInstr> initialisation) Creates an instance of aDeclarationPartsrecord class.(package private)Creates an instance of aDrainConditionrecord class.(package private)Evaluated(List<IRInstr> instructions, String primitiveResult, String expressionText, DebugInfo debugInfo) Creates an instance of aEvaluatedrecord class.(package private)FreshBooleanOperand(List<IRInstr> instructions, String result, String primitive) Creates an instance of aFreshBooleanOperandrecord class.(package private)InitializationData(List<IRInstr> instructions, String endTemp, String byTemp, String directionTemp, String currentTemp, ISymbol rangeType, ISymbol byType, ISymbol constrainedBase, String startTemp, boolean progressChecked) Creates an instance of aInitializationDatarecord class.OwnedEvaluation(List<IRInstr> instructions, String resultVariable, boolean owning) Creates an instance of aOwnedEvaluationrecord class.OwnedTemporaries(List<IRInstr> declarations, List<IRInstr> instructions, List<ResourceCloser.Closing> closings) Creates an instance of aOwnedTemporariesrecord class.(package private)StageSetupResult(List<IRInstr> preLoopInstructions, List<StageState> stageStates) Creates an instance of aStageSetupResultrecord class.(package private)StageWrapParams(EK9Parser.StreamPartContext stageCtx, List<IRInstr> innerBody, DebugInfo debugInfo) Creates an instance of aStageWrapParamsrecord class.(package private)StageWrapResult(List<IRInstr> wrappedBody, List<IRInstr> postLoopInstructions) Creates an instance of aStageWrapResultrecord class. -
Uses of IRInstr in org.ek9lang.compiler.phase7.support
Classes in org.ek9lang.compiler.phase7.support that implement interfaces with type arguments of type IRInstrModifier and TypeClassDescriptionfinal classCONCERN: Binary operator invocation with memory management.final classCreates evaluation instructions for Boolean._ofFalse() static method call.final classCONCERN: Comparison evaluation with boolean primitive extraction.final classCONCERN: Loop counter increment/decrement.classConverts the single IRInstr supplied by the supplier into a List with one element in.classConverts the single IRInstr supplied by the supplier into a List with one element in.final classCONCERN: Literal loading with memory management.final classCONCERN: Boolean primitive extraction from EK9 Boolean objects.classTriggers the expression processing with the given details.final classMemory management for CONSUMING a value that was already RETAIN'd by a producer.final classMemory management for CONSUMING a value that was already RETAIN'd by a producer.final classCONCERN: Unary operator invocation with memory management.final classCalls a supplier of main processing instructions and then adds in the memory management.final classCalls a supplier of main processing instructions and then adds in the memory management.Methods in org.ek9lang.compiler.phase7.support that return IRInstrModifier and TypeMethodDescriptionShortCircuitBlock.and(ShortCircuitBlock.Operands operands) RIGHT is evaluated only when LEFT is true.CycleGuardOwner.load(String resultVar, IAggregateSymbol aggregate, DebugInfo debugInfo) Load the constant for a guarded operator - a borrowed reference, neither retained nor released.ShortCircuitBlock.of(Function<LogicalDetails, IRInstr> operation, ShortCircuitBlock.Operands operands) The block for the given operation (LogicalOperationInstr::andOperationor::orOperation).ShortCircuitBlock.or(ShortCircuitBlock.Operands operands) RIGHT is evaluated only when LEFT is false.Methods in org.ek9lang.compiler.phase7.support that return types with arguments of type IRInstrModifier and TypeMethodDescriptionBinaryOperatorInvoker.apply(BinaryOperatorParams params) Invoke binary operator on two operands.BooleanFalseEvaluationCreator.apply(VariableDetails variableDetails) BooleanNotEvaluationCreator.apply(String booleanVariable, VariableDetails resultDetails) Creates Boolean._not() method call instructions.ComparisonEvaluator.apply(ComparisonParams params) Evaluate comparison and extract primitive boolean.ConstantCopyOnAccessLoader.apply(ISymbol constantSymbol, String resultVariable, DebugInfo debugInfo) Read the constant into resultVariable as a fresh copy.IncrementEvaluator.apply(IncrementParams params) Evaluate increment/decrement on the counter variable.IsSetEvaluationCreator.apply(String operandVariable, ISymbol operandSymbol, VariableDetails resultDetails) Creates _isSet() method call instructions.ManagedLiteralLoader.apply(LiteralParams params) Load literal value into temp variable with memory management.PrimitiveBooleanExtractor.apply(BooleanExtractionParams params) Extract primitive boolean from EK9 Boolean object.RecordExprProcessing.apply(ExprProcessingDetails details) ScopeRegisterOnly.apply(Supplier<List<IRInstr>> mainProcessing, VariableDetails target) UnaryOperatorInvoker.apply(UnaryOperatorParams params) Invoke unary operator on operand.VariableMemoryManagement.apply(Supplier<List<IRInstr>> mainProcessing, VariableDetails target) OwnershipStatements.armResultFresh(String chainResult, String value, DebugInfo debugInfo) THE move of a value just made, by one arm of a chain, into the chain's result - which is empty when an arm runs, since exactly one arm sets it (EK9_IR_OWNERSHIP_MODEL.md §4, merges):SLOT_ASSIGN r, v [consume, init], lowered toSTORE r, v.OwnershipStatements.borrowInScope(String variable, String scopeId, DebugInfo debugInfo) THE borrow with an explicit registration scope, for a body that pushes no frame (synthesis - tidy plan decision 3): a value that arrived at +0 (a CAST of a parameter, a LOAD) is owned for that scope and dropped at its exit.ConditionalEvaluation.conditionInstructions()Returns the value of theconditionInstructionsrecord component.OwnershipStatements.declaredOwnedSlot(String slot, String typeName, String scopeId, boolean typed, DebugInfo debugInfo) THE declaration of a compiler-made slot its scope owns and that nothing initialises where it is declared - it is only ever rebound (a stream join accumulator, a type-boundary out-variable): the scope releases its LAST value (A10).OwnershipStatements.declaredSlot(String slot, String typeName, String owner, DebugInfo debugInfo) THE declaration of a named slot and of its owner: a local is owned by the scope that declares it, a parameter or returning variable by the CALLER (OwnershipInstr.CALLER), a property by its OBJECT (OwnershipInstr.OBJECT).OwnershipStatements.droppedAtExit(String value, String scopeId, DebugInfo debugInfo) THE value-ownership function (D-O11, EK9_IR_OWNERSHIP_STAGE1_DESIGN.md §11): states, where a value is made, that the scope owns it -DROP_AT_EXIT, dropped at every exit of the scope's activation (lowered toSCOPE_REGISTER).THE extra count a value takes so that it outlives the region it was evaluated in - a chain arm's value handed out as the chain's result while the arm's region still drops its own count (EK9_IR_OWNERSHIP_MODEL.md §4, an escape):OWN v.OperandEvaluation.evaluationInstructions()Returns the value of theevaluationInstructionsrecord component.ScopedInstructionExecutor.execute(Supplier<List<IRInstr>> instructionGenerator, DebugInfo debugInfo) Execute instructions within temporary scope.OwnershipStatements.fieldAssigned(FieldTarget field, String value, OwnershipInstr.AssignMode mode, boolean init, DebugInfo debugInfo) THE store of a value into an object's FIELD (family 6): drop the field's old value and store the new one -[copy]takes the field's own reference to a value something else still owns,[consume]moves an owned value in;initis the fact that the field is empty here (a constructor's first store), so there is nothing to drop.OwnershipStatements.handedOver(String target, String source, DebugInfo debugInfo) THE hand-over of a slot's value to another slot that is empty here, after which the source slot is done with: a control-flow expression's returning variable handed to the expression's result (J3).CycleGuardOwner.initialise(IAggregateSymbol aggregate, String tempVar, DebugInfo debugInfo) Make the constant, once, in the type's_c_init.OwnershipStatements.initialised(String slot, String value, DebugInfo debugInfo) THE first value of a local declared with one (x <- v): the slot takes its own reference to a value its scope still owns, and the declaring scope owns the slot.OwnershipStatements.initialisedFresh(String slot, String value, DebugInfo debugInfo) THE first value of a local declared with a value just made (x <- Call()): the slot takes the producer's count, so the value is neither registered with a scope nor retained again (EK9_IR_OWNERSHIP_MODEL.md §6,[consume]).ConditionEvaluationResult.instructions()Returns the value of theinstructionsrecord component.ConstantCopyOnAccessLoader.LoadedConstant.instructions()Returns the value of theinstructionsrecord component.LoopIterationCondition.Evaluated.instructions()Returns the value of theinstructionsrecord component.LoopIterationCondition.instructions()Returns the value of theinstructionsrecord component.PromotedVariable.instructions()Returns the value of theinstructionsrecord component.ScopedInstructionExecutor.ScopedBlock.instructions()Returns the value of theinstructionsrecord component.The stores of each captured variable's property from the capture constructor's parameter at the same position.The stores of a construct whose capture constructor's parameters are its captured variables themselves (a dynamic function's, or a dynamic class's synthetic one).SamenessTypeCheck.of(IRGenerationContext stackContext, String otherVar, String differentTypeLabel, DebugInfo debugInfo) The check:thisagainstotherVar, going todifferentTypeLabelwhen they differ.SanitizedParameterPrologue.of(IRGenerationContext stackContext, List<ISymbol> parameters) Create the prologue that cleans everySANITIZED_REQUIREDparameter in place, each instruction attributed to the parameter's own declaration.SanitizedParameterPrologue.of(IRGenerationContext stackContext, List<ISymbol> parameters, DebugInfo debugInfo) Create the prologue with every instruction attributed todebugInfo.PromotionResult.promotionInstructions()Returns the value of thepromotionInstructionsrecord component.OwnershipStatements.propertyAssigned(String property, String value, boolean init, DebugInfo debugInfo) THE store of a value into a PROPERTY named as a slot of its object (this.p): the property takes its own reference to a value something else still owns, and drops the value it replaces unless it is empty here (init, a property initialiser's first store).THE rebinding of a slot that already holds a value - drop the old one, take a reference to the new one:SLOT_ASSIGN x, v [copy](lowered:RELEASE x; STORE x, v; RETAIN x).OwnershipStatements.reboundFresh(String slot, String value, DebugInfo debugInfo) THE rebinding of a slot to a value just made (x := Call()): drop the old value and move the new one in.VariableMemoryManagement.registerIfOwnedProducer(List<IRInstr> instructions, VariableDetails target) SCOPE_REGISTER the target ONLY when it is a freshly produced (+1) value, adding nothing for a borrow.OwnershipStatements.returnFresh(String returnVariable, String value, DebugInfo debugInfo) THE move of a value just made into the returning variable: the return variable takes the producer's count, so the value is neither registered with a scope nor retained again (EK9_IR_OWNERSHIP_MODEL.md §6,[consume]).OwnershipStatements.returnSlot(String returnVariable, String typeName, DebugInfo debugInfo) THE declaration of the return variable: owned by the CALLER, never released by a scope here -SLOT_DECLARE rtn, T, CALLER(lowered toREFERENCE rtn, T).OwnershipStatements.storeReturn(String returnVariable, String value, DebugInfo debugInfo) THE store of a result into the returning variable (tidy plan 8a rule 3):SLOT_ASSIGN rtn, v [copy, init]- the return variable takes its own reference to a value its scope still owns, into a slot that is empty here - which lowers to exactlySTORE rtn, v; RETAIN rtn.Method parameters in org.ek9lang.compiler.phase7.support with type arguments of type IRInstrModifier and TypeMethodDescriptionScopeRegisterOnly.apply(Supplier<List<IRInstr>> mainProcessing, VariableDetails target) VariableMemoryManagement.apply(Supplier<List<IRInstr>> mainProcessing, VariableDetails target) BooleanCondition.asBoolean(EK9Parser.ExpressionContext condition, String conditionVariable, DebugInfo debugInfo, List<IRInstr> instructions) The Boolean holding the condition: the evaluated variable itself, or - for a type that promotes to Boolean - the result of its_promote(), appended toinstructions(scope-local, released with the scope).DelegateLoad.borrowed(List<IRInstr> instructions, Supplier<String> newTemp, String objectVar, String ownerType, String delegateType, String scopeId, DebugInfo debugInfo) LoadobjectVar.delegateinto a new temporary, borrowed forscopeId.WrapperGivenAsAny.castWhenExactly(List<IRInstr> instructions, Supplier<String> tempNames, String operandName, String wrapperType, String notThisWrapperLabel, String scopeId, DebugInfo debugInfo) The test of an operand for being exactlywrapperType, and its cast when it is.WrapperGivenAsAny.delegateWhenExactly(List<IRInstr> instructions, Supplier<String> tempNames, String parameterName, String wrapperType, String delegateType, String passAsIsLabel, String scopeId, DebugInfo debugInfo) The value to hand a base operator for a parameter declaredAny: the wrapper's delegate when the argument is exactlywrapperType, the argument as it is otherwise.voidPanicThrowInstrs.emit(IRGenerationContext stackContext, List<IRInstr> instructions, String message, String exitCode, String scopeId, DebugInfo debugInfo) Append the construct-and-throw-Panic sequence toinstructions.voidStrictAbsent.emitIfEnabled(IRGenerationContext stackContext, List<IRInstr> instructions, StrictAbsent.Observer observer, DebugInfo debugInfo) In strict-absent mode, append the Panic toinstructions- the start of the branch a compiled absence test takes on a null.ScopedInstructionExecutor.execute(Supplier<List<IRInstr>> instructionGenerator, DebugInfo debugInfo) Execute instructions within temporary scope.ScopedInstructionExecutor.executeWithScopeId(Function<String, List<IRInstr>> body, DebugInfo debugInfo) THE scoped body for a generator whose body needs, or whose caller needs, the scope id.booleanVariableMemoryManagement.isOwnedProducer(List<IRInstr> instructions, String target) True when the evaluation handstargetback at +1, owned by whoever receives it - made OWNED by the instruction that ends it (ValueKind.madeBy(IRInstr), the rule the verifier checks against: a call, constructors and operators included, or a literal) or an escaping chain result: THE question a receiver asks before owning a value rather than borrowing it, or moving it rather than copying it.static PromotedVariableCreate a promoted variable result.ShortCircuitBlock.of(Function<LogicalDetails, IRInstr> operation, ShortCircuitBlock.Operands operands) The block for the given operation (LogicalOperationInstr::andOperationor::orOperation).BooleanCondition.primitiveOf(String booleanVariable, DebugInfo debugInfo, List<IRInstr> instructions) The primitive boolean a branch reads from a variable already holding a Boolean (BooleanCondition.asBoolean(EK9Parser.ExpressionContext, String, DebugInfo, List)):_true(), appended toinstructions.CollectionElementPromoter.promoteIfRequired(ISymbol elementType, ISymbol targetType, String elementTemp, DebugInfo debugInfo, List<IRInstr> setupInstructions) Insert a#^promotion for a collection element when its static type is not directly assignable to the collection's resolved element type but is coercible to it (single promotion, per EK9 rules).CollectionElementPromoter.promoteIfRequired(ISymbol elementType, ISymbol targetType, String elementTemp, DebugInfo debugInfo, List<IRInstr> setupInstructions, boolean escaping) AsCollectionElementPromoter.promoteIfRequired(ISymbol, ISymbol, String, DebugInfo, List), butescapingselects the ARC of any inserted promote:falsefor a scope-local value (collection element, range bound, comparison operand) — RETAIN + SCOPE_REGISTER;truefor a value that ESCAPES the current scope (a coalescing/ternary body-result that becomes the expression value) — RETAIN only, the consumer takes ownership.VariableMemoryManagement.registerIfOwnedProducer(List<IRInstr> instructions, VariableDetails target) SCOPE_REGISTER the target ONLY when it is a freshly produced (+1) value, adding nothing for a borrow.BooleanCondition.toPrimitive(EK9Parser.ExpressionContext condition, String conditionVariable, DebugInfo debugInfo, List<IRInstr> instructions) The primitive boolean a branch reads: the condition as a Boolean (BooleanCondition.asBoolean(EK9Parser.ExpressionContext, String, DebugInfo, List)), then_true().Constructor parameters in org.ek9lang.compiler.phase7.support with type arguments of type IRInstrModifierConstructorDescriptionConditionalEvaluation(List<IRInstr> conditionInstructions, String conditionResult) Creates an instance of aConditionalEvaluationrecord class.ConditionEvaluationResult(List<IRInstr> instructions, String primitiveVariableName) Creates an instance of aConditionEvaluationResultrecord class.Creates an instance of aEvaluatedrecord class.LoadedConstant(List<IRInstr> instructions, String resultVariable) Creates an instance of aLoadedConstantrecord class.LoopIterationCondition(String scopeId, List<IRInstr> instructions, String resultVariable, String primitiveCondition) Creates an instance of aLoopIterationConditionrecord class.OperandEvaluation(List<IRInstr> evaluationInstructions, String operandName) Creates an instance of aOperandEvaluationrecord class.PromotedVariable(String variable, List<IRInstr> instructions) Creates an instance of aPromotedVariablerecord class.RecordExprProcessing(Function<ExprProcessingDetails, List<IRInstr>> processor, VariableMemoryManagement variableMemoryManagement) ScopedBlock(String scopeId, List<IRInstr> instructions) Creates an instance of aScopedBlockrecord class. -
Uses of IRInstr in org.ek9lang.compiler.phase7.synthesis
Methods in org.ek9lang.compiler.phase7.synthesis that return types with arguments of type IRInstrModifier and TypeMethodDescriptionAbstractSyntheticGenerator.fieldIsSetCall(ISymbol field, String fieldVar, String resultVar, DebugInfo debugInfo, String scopeId) THEfield._isSet()step of the field-wise synthetic generators - a trait-typed field is dispatched through its interface.AbstractSyntheticGenerator.fieldOperatorCall(ISymbol field, String fieldVar, String glyph, String jvmMethodName, String otherVar, String returnTypeName, String resultVar, DebugInfo debugInfo, String scopeId) THE per-field "call the field type's own operator, or fall back to Any's" step of every field-wise synthetic generator (==,<=>,#?,$,$$) - use this, never a hand-writtenfieldCapable ? getType(field) : getAnyType()(SYN-3).CloseGenerator.generate(MethodSymbol operatorSymbol, AggregateSymbol aggregateSymbol) Generate the _close operator IR for the given aggregate.CompareGenerator.generate(MethodSymbol operatorSymbol, AggregateSymbol aggregateSymbol) Generate the _cmp operator IR for the given aggregate.CopyGenerator.generate(MethodSymbol operatorSymbol, AggregateSymbol aggregateSymbol) Generate the _copy operator IR for the given aggregate - its own:=:(Owner), or the override of an inherited:=:(Super)signature (PolymorphicCopy, Q5b; told apart by the parameter type).DelegationGenerator.generate(MethodSymbol methodSymbol, AggregateSymbol aggregateSymbol) Generate delegation IR for a synthetic delegation method.DerivedComparisonGenerator.generate(String operatorName, MethodSymbol operatorSymbol, AggregateSymbol aggregateSymbol) Generate IR for a derived comparison operator.EnumConstructorGenerator.generate(MethodSymbol constructorSymbol, AggregateSymbol aggregateSymbol) Generate a parameterized enum constructor.EnumFirstLastGenerator.generate(String operatorName, MethodSymbol operatorSymbol, AggregateSymbol aggregateSymbol) Generate the #< or #> operator for an enumeration.EnumIncrementDecrementGenerator.generate(String operatorName, MethodSymbol operatorSymbol, AggregateSymbol aggregateSymbol) Generate the ++ or -- operator for an enumeration.EnumIteratorGenerator.generate(MethodSymbol methodSymbol, AggregateSymbol aggregateSymbol) Generate the iterator() method for an enumeration.EnumPrimitiveOperatorGenerator.generate(EnumPrimitiveOperatorGenerator.Shape shape, MethodSymbol operatorSymbol, AggregateSymbol aggregateSymbol) EnumStringParamGenerator.generate(String operatorName, MethodSymbol operatorSymbol, AggregateSymbol aggregateSymbol) Generate a String-param comparison operator for an enumeration.EqualsGenerator.generate(MethodSymbol operatorSymbol, AggregateSymbol aggregateSymbol) Generate the _eq operator IR for the given aggregate.FieldSetStatusGenerator.generate(MethodSymbol methodSymbol, AggregateSymbol aggregateSymbol) Generate the _fieldSetStatus method IR for the given aggregate.FunctionIsSetGenerator.generate(MethodSymbol methodSymbol, FunctionSymbol functionSymbol) Generate the _isSet operator IR for the given function.HashCodeGenerator.generate(MethodSymbol operatorSymbol, AggregateSymbol aggregateSymbol) Generate the _hashcode operator IR for the given aggregate.InheritedDispatcherGenerator.generate(MethodSymbol entryPoint, AggregateSymbol aggregateSymbol) IsSetGenerator.generate(MethodSymbol methodSymbol, AggregateSymbol aggregateSymbol) Generate the _isSet operator IR for the given aggregate.NotEqualsGenerator.generate(MethodSymbol operatorSymbol, AggregateSymbol aggregateSymbol) Generate the _neq operator IR for the given aggregate.SamenessOverrideGenerator.generate(MethodSymbol operatorSymbol, AggregateSymbol aggregateSymbol) ToJsonGenerator.generate(MethodSymbol operatorSymbol, AggregateSymbol aggregateSymbol) Generate the _json operator IR for the given aggregate.ToStringGenerator.generate(MethodSymbol operatorSymbol, AggregateSymbol aggregateSymbol) Generate the _string operator IR for the given aggregate.AbstractSyntheticGenerator.generateBinaryOperatorGuards(String aggregateTypeName, ISymbol aggregateType, String paramName, String unsetLabel, SynthesisScope ctx) Generate isSet guards for binary operators (this and param).AbstractSyntheticGenerator.generateBooleanBranch(String booleanVar, String label, boolean branchIfTrue, SynthesisScope ctx) Extract primitive boolean from Boolean object and branch.CopyGenerator.generateCopyAccepts(MethodSymbol methodSymbol, AggregateSymbol aggregateSymbol) Generate the owner's_copyAccepts(target as Any) <- Boolean: istargetan instance of this owner (a SUBTYPE test - the owner or any class below it)? Asked of the SOURCE of a copy with the copy's target, so a copy runs in full only between objects whose nearest copy owner is the same class.AbstractSyntheticGenerator.generateCycleGuardedRegion(String exitMethod, AbstractSyntheticGenerator.CycleGuardEntry entry, List<IRInstr> body, String endLabel, SynthesisScope ctx) THE guarded region of a cycle-guarded operator whose exit returns nothing (?,==,<=>): the body runs as the try of a TRY_CATCH_FINALLY with NO catches whose finally is the guard's exit, so the exit runs on every path - including an exception thrown by a field's hand-written operator, which would otherwise leave this object's entry behind and make a later call read as a cycle (Contract 13).AbstractSyntheticGenerator.generateFieldLoad(String targetVar, String objectVar, String fieldName, String ownerTypeName, String fieldTypeName, DebugInfo debugInfo, String scopeId) Generate field load instruction with memory management using explicit LOAD_FIELD.AbstractSyntheticGenerator.generateFieldLoad(String targetVar, String objectVar, String fieldName, String ownerTypeName, String fieldTypeName, SynthesisScope ctx) Generate field load using SynthesisScope with explicit type information.AbstractSyntheticGenerator.generateFieldSetStatusCheck(String otherParamName, AggregateSymbol aggregateSymbol, DebugInfo debugInfo, String scopeId, String returnUnsetLabel) Generate field set status comparison check.AbstractSyntheticGenerator.generateIsSetGuard(String variableName, String typeName, ISymbol type, String unsetLabel, SynthesisScope ctx) Generate isSet guard check for a variable using SynthesisScope.AbstractSyntheticGenerator.generateIsSetGuard(String variableName, String typeName, ISymbol type, DebugInfo debugInfo, String unsetLabel, String scopeId) Generate isSet guard check for a variable with branch to unset return.AbstractSyntheticGenerator.generatePoisonableCycleGuardedRegion(String exitMethod, AbstractSyntheticGenerator.CycleGuardEntry entry, List<IRInstr> body, String unsetLabel, String keepLabel, SynthesisScope ctx) THE guarded region of a representation ($,$$): asAbstractSyntheticGenerator.generateCycleGuardedRegion(String, AbstractSyntheticGenerator.CycleGuardEntry, List, String, SynthesisScope), but the exit in the finally also says whether a cycle was met while the body ran.AbstractSyntheticGenerator.generateReplacingUnsetReturnBlockWithLabel(String labelName, String returnTypeName, String returnVarName, SynthesisScope ctx) AbstractSyntheticGenerator.generateUnsetReturnBlockWithLabel(String, String, String, DebugInfo, String)for a label reached with the return variable possibly holding a value - a representation poisoned by a cycle, discarding what it built (AbstractSyntheticGenerator.generatePoisonableCycleGuardedRegion(String, AbstractSyntheticGenerator.CycleGuardEntry, List, String, String, SynthesisScope)), as well as the guard's back-edge, where it is still empty: the unset value is MOVED in and REPLACES whatever is there (SLOT_ASSIGN rtn, v [consume], lowered to RELEASE rtn - null-safe - then STORE).AbstractSyntheticGenerator.generateResultReturnBlock(String labelName, String returnVarName, DebugInfo debugInfo, String scopeId) Generate a result return block that returns whatever is in the return variable.AbstractSyntheticGenerator.generateResultReturnBlock(String labelName, String returnVarName, SynthesisScope ctx) Generate result return block using SynthesisScope.AbstractSyntheticGenerator.generateStringLiteralLoad(String resultVar, String literalValue, DebugInfo debugInfo, String scopeId) Generate a string literal load with memory management.AbstractSyntheticGenerator.generateThisIsSetGuard(String aggregateTypeName, ISymbol aggregateType, String unsetLabel, SynthesisScope ctx) Generate isSet guard for 'this' using SynthesisScope.AbstractSyntheticGenerator.generateThisIsSetGuard(String aggregateTypeName, ISymbol aggregateType, DebugInfo debugInfo, String unsetLabel, String scopeId) Generate isSet guard check for 'this' with branch to unset return.AbstractSyntheticGenerator.generateUnsetReturnBlockWithLabel(String labelName, String returnTypeName, String returnVarName, DebugInfo debugInfo, String scopeId) Generate unset return block at a specific label.AbstractSyntheticGenerator.generateUnsetReturnBlockWithLabel(String labelName, String returnTypeName, String returnVarName, SynthesisScope ctx) Generate unset return block using SynthesisScope.AbstractSyntheticGenerator.CycleGuardEntry.instructions()Returns the value of theinstructionsrecord component.AbstractSyntheticGenerator.ScopeSetup.instructions()Returns the value of theinstructionsrecord component.AbstractSyntheticGenerator.runtimeTypeCheck(String differentTypeLabel, DebugInfo debugInfo) THE run-time-type check itself, the first step of the comparison: nothing whendifferentTypeLabelis null.AbstractSyntheticGenerator.runUnderCycleGuard(AbstractSyntheticGenerator.CycleGuardEntry guard, String exitMethod, List<IRInstr> checks, String endLabel, String resultLabel, SynthesisScope ctx) THE tail of a cycle-guarded?,==or<=>: enter the guard, runchecks(whose outcome blocks store intortnand end atendLabel) as the guarded region, then go on to the operator's result return block.Method parameters in org.ek9lang.compiler.phase7.synthesis with type arguments of type IRInstrModifier and TypeMethodDescriptionAbstractSyntheticGenerator.generateCycleGuardedRegion(String exitMethod, AbstractSyntheticGenerator.CycleGuardEntry entry, List<IRInstr> body, String endLabel, SynthesisScope ctx) THE guarded region of a cycle-guarded operator whose exit returns nothing (?,==,<=>): the body runs as the try of a TRY_CATCH_FINALLY with NO catches whose finally is the guard's exit, so the exit runs on every path - including an exception thrown by a field's hand-written operator, which would otherwise leave this object's entry behind and make a later call read as a cycle (Contract 13).AbstractSyntheticGenerator.generatePoisonableCycleGuardedRegion(String exitMethod, AbstractSyntheticGenerator.CycleGuardEntry entry, List<IRInstr> body, String unsetLabel, String keepLabel, SynthesisScope ctx) THE guarded region of a representation ($,$$): asAbstractSyntheticGenerator.generateCycleGuardedRegion(String, AbstractSyntheticGenerator.CycleGuardEntry, List, String, SynthesisScope), but the exit in the finally also says whether a cycle was met while the body ran.AbstractSyntheticGenerator.runUnderCycleGuard(AbstractSyntheticGenerator.CycleGuardEntry guard, String exitMethod, List<IRInstr> checks, String endLabel, String resultLabel, SynthesisScope ctx) THE tail of a cycle-guarded?,==or<=>: enter the guard, runchecks(whose outcome blocks store intortnand end atendLabel) as the guarded region, then go on to the operator's result return block.Constructor parameters in org.ek9lang.compiler.phase7.synthesis with type arguments of type IRInstrModifierConstructorDescriptionprotectedCycleGuardEntry(String ownerVar, String otherVar, List<IRInstr> instructions) Creates an instance of aCycleGuardEntryrecord class.protectedScopeSetup(SynthesisScope ctx, List<IRInstr> instructions) Creates an instance of aScopeSetuprecord class. -
Uses of IRInstr in org.ek9lang.compiler.phase7.synthesis.support
Methods in org.ek9lang.compiler.phase7.synthesis.support that return IRInstrModifier and TypeMethodDescriptionThe call instruction alone, for a caller that states the result's owner itself.PrimitiveToEk9Conversion.ofCall(String resultVar, String primitiveVar, String ek9TypeName, String ofParamType, SynthesisScope ctx) THEek9Type._of(primitiveVar)static call alone, for a caller that states the result's owner itself.Methods in org.ek9lang.compiler.phase7.synthesis.support that return types with arguments of type IRInstrModifier and TypeMethodDescriptionBuild the IR instructions for this call using explicit debugInfo and scopeId.SyntheticMethodCallBuilder.build(SynthesisScope ctx) Build the IR instructions for this call using a SynthesisScope context.SyntheticMethodCallBuilder.buildReturning(String returnVariable, DebugInfo debugInfo, String scopeId) SyntheticMethodCallBuilder.buildReturning(String, SynthesisScope)with explicit debugInfo and scopeId.SyntheticMethodCallBuilder.buildReturning(String returnVariable, SynthesisScope ctx) Build the call and hand its result straight to the returning variable: the result is made forrtnand nothing else, so it is moved there (OwnershipStatements.returnFresh(String, String, DebugInfo)) rather than registered with the scope and copied.Build the IR instructions for a void method call using explicit debugInfo and scopeId.SyntheticMethodCallBuilder.buildVoid(SynthesisScope ctx) Build the IR instructions for a void method call using a SynthesisScope context.PrimitiveToEk9Conversion.convert(String resultVar, String primitiveVar, String ek9TypeName, String ofParamType, SynthesisScope ctx) Build theek9Type._of(primitiveVar)static-call sequence with ARC ownership: the_offactory hands back a fresh object at +1, so the scope owns it (DROP_AT_EXIT) and nothing retains it.ReturnBlockHelper.generateBooleanReturn(String labelName, boolean value, String returnVarName, DebugInfo debugInfo, String scopeId) Generate a return block that returns a boolean value (true or false).ReturnBlockHelper.generateBooleanStore(String labelName, boolean value, String returnVarName, DebugInfo debugInfo, String scopeId, String continueLabel) Generate a block that sets the return variable to a boolean value and then goes on tocontinueLabelinstead of returning - for a value decided INSIDE a region that must be left by falling through (the cycle guard's try body, whose finally must run: Contract 13).ReturnBlockHelper.generateIntegerReturn(String labelName, int value, String returnVarName, DebugInfo debugInfo, String scopeId) Generate a return block that returns an integer literal value.ReturnBlockHelper.generateIntegerStore(String labelName, int value, String returnVarName, DebugInfo debugInfo, String scopeId, String continueLabel) Generate a block that sets the return variable to an integer literal and then goes on tocontinueLabelinstead of returning (seeReturnBlockHelper.generateBooleanStore(String, boolean, String, DebugInfo, String, String)).ReturnBlockHelper.generateUnsetReturn(String labelName, String returnTypeName, ISymbol returnType, String returnVarName, DebugInfo debugInfo, String scopeId) Generate a return block that returns an unset value of the given type.ReturnBlockHelper.generateUnsetStore(String labelName, String returnTypeName, ISymbol returnType, String returnVarName, DebugInfo debugInfo, String scopeId, String continueLabel) Generate a block that sets the return variable to an unset value of the given type and then goes on tocontinueLabelinstead of returning (seeReturnBlockHelper.generateBooleanStore(String, boolean, String, DebugInfo, String, String)).ReturnBlockHelper.generateValueReturn(String labelName, String returnVarName, DebugInfo debugInfo, String scopeId) Generate a return block that returns the value already in the return variable.ReturnBlockHelper.generateVoidReturn(String labelName, DebugInfo debugInfo, String scopeId) Generate a return block that returns nothing (a void operation): label, scope exit, void return. -
Uses of IRInstr in org.ek9lang.compiler.phase9
Classes in org.ek9lang.compiler.phase9 that implement interfaces with type arguments of type IRInstrModifier and TypeClassDescriptionfinal classTheSAFE_POINT after_threadsof one instruction list (EK9_NATIVE_CYCLE_COLLECTOR_DESIGN.md §13.11, T10): after the exit of the innermost scope in this list that holds a call which starts runtime threads and finishes only once they have all stopped (StartsAndStopsRuntimeThreads) - an async pipeline's statement scope, the scope of a server's accept or serve.(package private) final classTHE value each list of a chain hands to the chain's result: an arm's body result, the default's result - keyed by the list's identity (two equal lists are two places).final classTHE back-edge placement of IR_OPTIMISATION: a point instruction at the end of every loop body of an operation - the back edge, reached once per iteration after the body's own scope has dropped its values - unless one of the same opcode is already last.final classTheSAFE_POINT before_threadsof one instruction list (EK9_NATIVE_CYCLE_COLLECTOR_DESIGN.md §13.11, S0b): ahead of each call that starts runtime threads (StartsRuntimeThreads).final classTHE calls that hand values to runtime threads for the life of a server or of the program (EK9_NATIVE_CYCLE_COLLECTOR_DESIGN.md §13.11, S2): one handler serves every connection, the ready handler runs on its own thread while the caller serves, and the signal dispatcher keeps its handler until the program ends.(package private) final classThe two ownership rules that need to know which instruction lists run once per loop ITERATION (an activation), not just which scope ids exist - EK9_IR_OWNERSHIP_MODEL.md §12, stage 0, stated in today's opcodes: A value is owned by the activation that makes it (model V-F, the A11 rule).(package private) final classTHE variables an operation body's ownership form moves out of (the value of a consumingSLOT_ASSIGN).(package private) final classTHE findings of a per-body ownership check over every operation of a construct, each as"operation: problem", in operation order; an operation with no body has none.(package private) final classEvery reference an instruction stores INTO an object - the edges a published object could gain - classified by OPCODE, for V-P's audit (PublishVerifier, review 2026-11-02 M4).(package private) final classTHE short text of an instruction named in an ownership finding: a composite by its opcode, anything else by its IR text without the debug comment and the purity annotation, cut at 110 characters - so a finding shows the instruction's shape without the operation's IR.final classTHE calls that start runtime threads and finish only once every one of them has stopped (EK9_NATIVE_CYCLE_COLLECTOR_DESIGN.md §13.11, T10): a server'saccept,acceptUntilComplete,serveandserveUntilCompletereturn after shutting down the scheduler they started, and an async pipeline'sEk9Async.create()begins the statement whoseclose()drains its workers and does the same.final classTHE calls that start runtime threads (EK9_NATIVE_CYCLE_COLLECTOR_DESIGN.md §13.11, S0b): every callStartsAndStopsRuntimeThreadsnames - an async pipeline'sEk9Async.create(), a server's accept and serve, each of which starts the carrier scheduler - andSignals.register, which starts the signal dispatcher that never stops.Methods in org.ek9lang.compiler.phase9 that return types with arguments of type IRInstrModifier and TypeMethodDescriptionArmResults.apply(CompositeInstr composite) Lower an instruction list and every list nested in it, as one operation body.Methods in org.ek9lang.compiler.phase9 with parameters of type IRInstrModifier and TypeMethodDescription(package private) voidActivationScopes.instruction(IRInstr instruction) Track one instruction (only SCOPE_ENTER matters).(package private) List<PublishInstr> PublishedValues.of(IRInstr instruction, PublishedValues.Where where) ThePUBLISHes that must come immediately before this instruction, in order; empty for most.booleanbooleanMethod parameters in org.ek9lang.compiler.phase9 with type arguments of type IRInstrModifier and TypeMethodDescriptionvoidBackEdgePoints.accept(OperationInstr operation, Supplier<IRInstr> point) The problems in one operation body, in walk order; empty when it keeps both rules.The V-I findings of one operation body.The per-path findings of one operation body.The problems in one operation body; empty when it keeps every local rule.Lower an instruction list and every list nested in it, as one operation body.