Enum Class IROpcode
- All Implemented Interfaces:
Serializable
,Comparable<IROpcode>
,Constable
Enumeration of all IR opcodes used in the EK9 intermediate representation.
Key Design Principle: All EK9 operators become method calls (CALL instructions). No primitive arithmetic operations (ADD, SUB, etc.) are included - everything goes through EK9's object method dispatch system.
This design ensures target-agnostic IR that works equally well for: - JVM bytecode generation - LLVM-C++ target
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAssert that condition is true.Unconditional branch/jump.Branch if condition is false.Branch if condition is true.Standard method call with resolved signature.Dispatcher method call (runtime type-based dispatch).Static method/function call.Virtual method call (polymorphic dispatch).Cleanup after exception handling.Load value from memory location into temporary/register.Load literal/constant value into temporary/register.Declare variable reference (no memory allocation).Decrement object reference count.Increment object reference count.Return from method/function.Enter new memory management scope.Exit memory management scope.Register object for automatic cleanup in scope.Setup exception handler for try block.Store value from temporary/register into memory location.Throw exception. -
Method Summary
-
Enum Constant Details
-
LOAD
Load value from memory location into temporary/register. Format: LOAD dest = source_location -
STORE
Store value from temporary/register into memory location. Format: STORE dest_location = source -
LOAD_LITERAL
Load literal/constant value into temporary/register. Format: LOAD_LITERAL dest = literal_value, literal_type Handles: String literals, numeric literals, boolean literals, etc. -
REFERENCE
Declare variable reference (no memory allocation). Format: REFERENCE variable_name, type_info Used for parameters and variable-only declarations. Backend handles appropriate reference storage. -
CALL
Standard method call with resolved signature. Format: CALL result = object.method(args...) Handles: EK9 operators (a + b → a._add(b)), normal method calls -
CALL_VIRTUAL
Virtual method call (polymorphic dispatch). Format: CALL_VIRTUAL result = object.method(args...) -
CALL_STATIC
Static method/function call. Format: CALL_STATIC result = Type.method(args...) -
CALL_DISPATCHER
Dispatcher method call (runtime type-based dispatch). Format: CALL_DISPATCHER result = object.dispatcherMethod(args...) Uses runtime type information and dispatch matrix -
BRANCH
Unconditional branch/jump. Format: BRANCH target_label -
BRANCH_TRUE
Branch if condition is true. Format: BRANCH_TRUE condition, target_label -
BRANCH_FALSE
Branch if condition is false. Format: BRANCH_FALSE condition, target_label -
RETURN
Return from method/function. Format: RETURN [value] -
ASSERT
Assert that condition is true. Format: ASSERT condition Traps/throws if condition is false. -
THROW
Throw exception. Format: THROW exception_object -
SETUP_HANDLER
Setup exception handler for try block. Format: SETUP_HANDLER handler_label, exception_types... -
CLEANUP
Cleanup after exception handling. Format: CLEANUP -
RETAIN
Increment object reference count. Format: RETAIN object JVM: no-op, LLVM: increment ref count -
RELEASE
Decrement object reference count. Format: RELEASE object JVM: no-op, LLVM: decrement ref count, possible deallocation -
SCOPE_ENTER
Enter new memory management scope. Format: SCOPE_ENTER scope_id Creates cleanup boundary for exception safety -
SCOPE_EXIT
Exit memory management scope. Format: SCOPE_EXIT scope_id Automatically RELEASE all registered objects in scope -
SCOPE_REGISTER
Register object for automatic cleanup in scope. Format: SCOPE_REGISTER object, scope_id Object will be RELEASE'd when scope exits
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-