Class ListLiteralInstr
java.lang.Object
org.ek9lang.compiler.ir.instructions.IRInstr
org.ek9lang.compiler.ir.instructions.ListLiteralInstr
- All Implemented Interfaces:
INode
IR instruction for list literal construction with pre-sized allocation.
Contains structured data for building a list from pre-evaluated element temps. All element expressions have been evaluated into temp variables by Phase 7 before this instruction is created.
Backends can choose optimal construction strategy:
- JVM:
new ArrayList(N)+ per-element_addAss() - LLVM: single allocation with known size
-
Method Summary
Modifier and TypeMethodDescriptionstatic ListLiteralInstrcreate(String result, List<IRInstr> setupInstructions, ListLiteralDetails details, String scopeId, DebugInfo debugInfo) Create a list literal instruction.Get the list literal details.Get the scope ID for memory management.Get the setup instructions (element evaluation + memory management).toString()Methods inherited from class IRInstr
accept, addOperand, addOperands, equals, getDebugInfo, getEscapeMetaData, getOpcode, getOperands, getResult, hasEscapeMetaData, hashCode, hasResult, isControlFlow, isLabel, isMemoryManagement, isMethodCall, setEscapeMetaData
-
Method Details
-
create
public static ListLiteralInstr create(String result, List<IRInstr> setupInstructions, ListLiteralDetails details, String scopeId, DebugInfo debugInfo) Create a list literal instruction.- Parameters:
result- Variable to store the resulting ListsetupInstructions- Instructions to evaluate elements and manage memorydetails- List literal details (type, element temps, count)scopeId- Scope for memory managementdebugInfo- Source location information- Returns:
- ListLiteralInstr
-
getSetupInstructions
-
getDetails
Get the list literal details. -
getScopeId
Get the scope ID for memory management. -
toString
-