Package org.ek9lang.compiler.ir.instructions
package org.ek9lang.compiler.ir.instructions
IR Instruction Classes - The instruction set for EK9 intermediate representation.
This package contains the sealed hierarchy of IR instructions that represent all executable operations in an EK9 program. Each instruction type corresponds to a specific category of operation.
Instruction Categories:
LiteralInstr- Literal value loadingMemoryInstr- Variable load/store operationsCallInstr- Method and function callsBranchInstr- Conditional and unconditional branchesLabelInstr- Branch targetsScopeInstr- Scope management and ARCThrowInstr- Exception throwingLogicalOperationInstr- AND/OR operationsControlFlowChainInstr- Complex control flowForRangePolymorphicInstr- FOR-RANGE loopsBasicBlockInstr- Basic block containerProgramEntryPointInstr- Program entry point
Coverage Instrumentation:
CoverageProbeInstr- Coverage probe insertionCoverageRegisterInstr- Coverage registrationCoverageFinalizeInstr- Coverage finalization
Testing Support:
AssertThrowsInstr- Assert throws verification
The INode interface enables the visitor pattern
for processing instructions.
-
ClassDescriptionHigh-level IR instruction for creating an aspect-woven proxy.IR instruction for test-only assertion constructs that wrap expressions in try-catch.Represents a basic block in the EK9 IR - a sequence of instructions with single entry and exit.Specialized IR instruction for control flow operations (BRANCH, BRANCH_TRUE, BRANCH_FALSE, ASSERT, RETURN).Specialized IR instruction for method calls (CALL, CALL_VIRTUAL, CALL_STATIC, CALL_DISPATCHER).
CANCEL_POINT: a point where an async task the pipeline no longer needs stops (EK9_BACKEND_IR_CONTRACTS.md Contract 24).IR instruction for explicit type casting.An instruction that holds nested instruction lists - THE one statement of which lists a composite has, in which order, and whether each runs once or once per loop iteration.How often a nested list runs each time its composite runs.One nested list.Resolves the single nominal super type a construct extends, so backends can read it mechanically from the IR (IRConstruct.getSuperType()) rather than each re-deriving it from the symbol.Unified IR instruction for all EK9 control flow constructs.Specialized IR instruction for coverage finalization (COVERAGE_FINALIZE).Specialized IR instruction for coverage probe recording (COVERAGE_PROBE).Specialized IR instruction for coverage module registration (COVERAGE_REGISTER).IR instruction for dict literal construction with pre-sized allocation.High-level IR instruction for a precomputed dispatch table.High-level IR instruction for generating enum iterator implementation.THE 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).THE executed instructions of one operation (one callable), flattened asExecutedInstructionsIndescribes - the per-callable unit an IR analysis reads.Represents a field/property declaration in an EK9 construct (class, record, component, etc.).Specialized IR instruction for EK9 polymorphic for-range loops.Dispatch case for ascending loops (direction < 0).An extra condition evaluated at the top of every iteration, before the range test:evaluationis run, then the loop ends unlessprimitiveis true.Dispatch case for descending loops (direction > 0).Container for all three dispatch cases in a for-range loop.Whether the counter has REACHED the end:primitiveis read after the body, and the loop stops BEFORE the increment when it is true.Dispatch case for equal loops (direction == 0).Non-executable metadata about the loop structure.The run-time PROGRESS check of a range whose counter type can wrap or not move (Time, and every user-defined range type - decided at compile time byRangeProgressCheck, never by a back end).Scope identifiers for different parts of the loop structure.Whether this iteration's loop value is usable:evaluationis run right after the loop variable is set up and the body is skipped (the iteration still reaches its end check and increment) unlessprimitiveis true.Models the concept of an Intermediate Representation construct.Specialised IR instruction for the input-variation numerator (INPUT_CLASS_PROBE).What this instruction is: an entry probe, or one edge of a §5.3 assert window.Discriminator for theCastInstr.instanceOf(String, String, String, InstanceOfKind, DebugInfo)IR instruction.In EK9 every construct becomes one of these nodes.Base class for all IR instructions in the EK9 intermediate representation.Specialized IR instruction for control flow labels (LABEL).IR instruction for list literal construction with pre-sized allocation.IR instruction for loading literal/constant values.IR instruction for logical operations (AND/OR) with short-circuit capability.The type of logical operation.Specialized IR instruction for memory operations (LOAD, STORE, ALLOCA, REFERENCE).An operation on some sort on a Construct.The ownership form of the IR (EK9_IR_OWNERSHIP_MODEL.md §10):OWN,DROP,DROP_AT_EXIT,SLOT_DECLARE,SLOT_ASSIGN,FIELD_ASSIGN.How a slot or field assignment takes its value.THE handling of a composite's nested list that may be absent (null): an absent list is not listed (PresentNestedLists.add(List, String, List, CompositeInstr.Activation), forCompositeInstr.nestedLists()) and stays absent when the lists are rewritten (PresentNestedLists.rewritten(List, UnaryOperator), forCompositeInstr.withNestedLists(UnaryOperator)).IR instruction for loading primitive literal values (int, boolean, java.lang.String).Specialized IR instruction for profiling function entry (PROFILING_ENTRY).Specialized IR instruction for profiling function exit (PROFILING_EXIT).IR instruction containing all discovered programs and their metadata.Visitor interface for specialized handling of ProgramEntryPointInstr.PUBLISH value, reason[, holder]: from here on the value, and everything it reaches, is shared with runtime threads for as long as the program runs (EK9_NATIVE_CYCLE_COLLECTOR_DESIGN.md §13.11, S2 and S2b; re-investigation F1).Why a value is published - which fact allows it.SAFE_POINT: a point where the native cycle collector may run (EK9_NATIVE_CYCLE_COLLECTOR_DESIGN.md §14).Which safe point.IR instruction for sanitizing string values to prevent injection attacks.Specialized IR instruction for scope management (SCOPE_ENTER, SCOPE_EXIT, SCOPE_REGISTER).Shared IR-text rendering for the nested setup block of composite instructions (LIST_LITERAL / DICT_LITERAL / STRING_INTERPOLATION).IR instruction for string interpolation.Specialized IR instruction for throwing exceptions (THROW).