Class MemoryInstr

java.lang.Object
org.ek9lang.compiler.ir.IRInstr
org.ek9lang.compiler.ir.MemoryInstr
All Implemented Interfaces:
INode

public final class MemoryInstr extends IRInstr
Specialized IR instruction for memory operations (LOAD, STORE, ALLOCA, REFERENCE).

Memory instructions handle variable access, allocation, and reference declaration in the EK9 IR.

  • Method Details

    • load

      public static MemoryInstr load(String destination, String sourceLocation)
      Create LOAD instruction: LOAD dest = source_location.
    • load

      public static MemoryInstr load(String destination, String sourceLocation, DebugInfo debugInfo)
      Create LOAD instruction with debug info: LOAD dest = source_location.
    • store

      public static MemoryInstr store(String destinationLocation, String source)
      Create STORE instruction: STORE dest_location = source.
    • store

      public static MemoryInstr store(String destinationLocation, String source, DebugInfo debugInfo)
      Create STORE instruction with debug info: STORE dest_location = source.
    • reference

      public static MemoryInstr reference(String variableName, String typeInfo)
      Create REFERENCE instruction: REFERENCE variable_name, type_info.
    • reference

      public static MemoryInstr reference(String variableName, String typeInfo, DebugInfo debugInfo)
      Create REFERENCE instruction with debug info: REFERENCE variable_name, type_info.
    • retain

      public static MemoryInstr retain(String object)
      Create RETAIN instruction: RETAIN object, i.e. increment the ARC (automatic reference counting).
    • retain

      public static MemoryInstr retain(String object, DebugInfo debugInfo)
      Create RETAIN instruction with debug info: RETAIN object, i.e. increment the ARC (automatic reference counting)
    • release

      public static MemoryInstr release(String object)
      Create RELEASE instruction: RELEASE object, decrement ARC.
    • release

      public static MemoryInstr release(String object, DebugInfo debugInfo)
      Create RELEASE instruction with debug info: RELEASE object, decrement ARC.
    • isNull

      public static MemoryInstr isNull(String result, String operand)
      Create IS_NULL instruction: IS_NULL result = operand.
    • isNull

      public static MemoryInstr isNull(String result, String operand, DebugInfo debugInfo)
      Create IS_NULL instruction with debug info: IS_NULL result = operand.
    • addOperand

      public MemoryInstr addOperand(String operand)
      Description copied from class: IRInstr
      Add operand to this instruction.
      Overrides:
      addOperand in class IRInstr
    • addOperands

      public MemoryInstr addOperands(String... operands)
      Description copied from class: IRInstr
      Add multiple operands to this instruction.
      Overrides:
      addOperands in class IRInstr