Class MemoryInstruction
java.lang.Object
org.ek9lang.compiler.ir.IRInstruction
org.ek9lang.compiler.ir.MemoryInstruction
- All Implemented Interfaces:
INode
Specialized IR instruction for memory operations (LOAD, STORE, ALLOCA).
Memory instructions handle variable access and allocation in the EK9 IR.
-
Method Summary
Modifier and TypeMethodDescriptionaddOperand
(String operand) Add operand to this instruction.addOperands
(String... operands) Add multiple operands to this instruction.static MemoryInstruction
Create ALLOCA instruction: ALLOCA variable_name, type_infostatic MemoryInstruction
Create ALLOCA instruction with debug info: ALLOCA variable_name, type_infostatic MemoryInstruction
allocObject
(String result, String constructorCall) Create ALLOC_OBJECT instruction: ALLOC_OBJECT result = constructor_callstatic MemoryInstruction
allocObject
(String result, String constructorCall, DebugInfo debugInfo) Create ALLOC_OBJECT instruction with debug info: ALLOC_OBJECT result = constructor_callstatic MemoryInstruction
Create LOAD instruction: LOAD dest = source_locationstatic MemoryInstruction
Create LOAD instruction with debug info: LOAD dest = source_locationstatic MemoryInstruction
Create RELEASE instruction: RELEASE objectstatic MemoryInstruction
Create RELEASE instruction with debug info: RELEASE objectstatic MemoryInstruction
Create RETAIN instruction: RETAIN objectstatic MemoryInstruction
Create RETAIN instruction with debug info: RETAIN objectstatic MemoryInstruction
Create STORE instruction: STORE dest_location = sourcestatic MemoryInstruction
Create STORE instruction with debug info: STORE dest_location = sourceMethods inherited from class org.ek9lang.compiler.ir.IRInstruction
accept, equals, getDebugInfo, getOpcode, getOperands, getResult, hashCode, hasResult, isControlFlow, isMemoryManagement, isMethodCall, toString
-
Method Details
-
load
Create LOAD instruction: LOAD dest = source_location -
load
public static MemoryInstruction load(String destination, String sourceLocation, DebugInfo debugInfo) Create LOAD instruction with debug info: LOAD dest = source_location -
store
Create STORE instruction: STORE dest_location = source -
store
public static MemoryInstruction store(String destinationLocation, String source, DebugInfo debugInfo) Create STORE instruction with debug info: STORE dest_location = source -
alloca
Create ALLOCA instruction: ALLOCA variable_name, type_info -
alloca
Create ALLOCA instruction with debug info: ALLOCA variable_name, type_info -
allocObject
Create ALLOC_OBJECT instruction: ALLOC_OBJECT result = constructor_call -
allocObject
public static MemoryInstruction allocObject(String result, String constructorCall, DebugInfo debugInfo) Create ALLOC_OBJECT instruction with debug info: ALLOC_OBJECT result = constructor_call -
retain
Create RETAIN instruction: RETAIN object -
retain
Create RETAIN instruction with debug info: RETAIN object -
release
Create RELEASE instruction: RELEASE object -
release
Create RELEASE instruction with debug info: RELEASE object -
addOperand
Description copied from class:IRInstruction
Add operand to this instruction.- Overrides:
addOperand
in classIRInstruction
-
addOperands
Description copied from class:IRInstruction
Add multiple operands to this instruction.- Overrides:
addOperands
in classIRInstruction
-