Class ScopeInstruction
java.lang.Object
org.ek9lang.compiler.ir.IRInstruction
org.ek9lang.compiler.ir.ScopeInstruction
- All Implemented Interfaces:
INode
Specialized IR instruction for scope management (SCOPE_ENTER, SCOPE_EXIT, SCOPE_REGISTER).
Scope instructions provide exception-safe memory management for EK9. They are no-ops on JVM (garbage collected) but generate cleanup code for LLVM targets.
-
Method Summary
Modifier and TypeMethodDescriptionaddOperand
(String operand) Add operand to this instruction.addOperands
(String... operands) Add multiple operands to this instruction.static ScopeInstruction
Create scope enter instruction: SCOPE_ENTER scope_id Establishes a new memory management scope for exception safety.static ScopeInstruction
Create scope enter instruction with debug info: SCOPE_ENTER scope_idstatic ScopeInstruction
Create scope exit instruction: SCOPE_EXIT scope_id Automatically RELEASE all objects registered in this scope.static ScopeInstruction
Create scope exit instruction with debug info: SCOPE_EXIT scope_idGet object name for SCOPE_REGISTER instructions.Get scope ID for this scope instruction.static ScopeInstruction
Create scope register instruction: SCOPE_REGISTER object, scope_id Register object for automatic cleanup when scope exits.static ScopeInstruction
Create scope register instruction with debug info: SCOPE_REGISTER object, scope_idMethods inherited from class org.ek9lang.compiler.ir.IRInstruction
accept, equals, getDebugInfo, getOpcode, getOperands, getResult, hashCode, hasResult, isControlFlow, isMemoryManagement, isMethodCall, toString
-
Method Details
-
enter
Create scope enter instruction: SCOPE_ENTER scope_id Establishes a new memory management scope for exception safety. -
enter
Create scope enter instruction with debug info: SCOPE_ENTER scope_id -
exit
Create scope exit instruction: SCOPE_EXIT scope_id Automatically RELEASE all objects registered in this scope. -
exit
Create scope exit instruction with debug info: SCOPE_EXIT scope_id -
register
Create scope register instruction: SCOPE_REGISTER object, scope_id Register object for automatic cleanup when scope exits. -
register
Create scope register instruction with debug info: SCOPE_REGISTER object, scope_id -
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
-
getScopeId
Get scope ID for this scope instruction. -
getObject
Get object name for SCOPE_REGISTER instructions.
-