Class DictLiteralInstr
java.lang.Object
org.ek9lang.compiler.ir.instructions.IRInstr
org.ek9lang.compiler.ir.instructions.DictLiteralInstr
- All Implemented Interfaces:
INode
IR instruction for dict literal construction with pre-sized allocation.
Contains structured data for building a dict from pre-evaluated key/value temps. All key and value expressions have been evaluated into temp variables by Phase 7 before this instruction is created.
Backends can choose optimal construction strategy:
- JVM:
new LinkedHashMap(N, 1.0f)+ per-entry_putDirect(key, value) - LLVM: single allocation with known size
-
Method Summary
Modifier and TypeMethodDescriptionstatic DictLiteralInstrcreate(String result, List<IRInstr> setupInstructions, DictLiteralDetails details, String scopeId, DebugInfo debugInfo) Create a dict literal instruction.Get the dict literal details.Get the scope ID for memory management.Get the setup instructions (key/value 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 DictLiteralInstr create(String result, List<IRInstr> setupInstructions, DictLiteralDetails details, String scopeId, DebugInfo debugInfo) Create a dict literal instruction.- Parameters:
result- Variable to store the resulting DictsetupInstructions- Instructions to evaluate keys/values and manage memorydetails- Dict literal details (type, entries, count)scopeId- Scope for memory managementdebugInfo- Source location information- Returns:
- DictLiteralInstr
-
getSetupInstructions
-
getDetails
Get the dict literal details. -
getScopeId
Get the scope ID for memory management. -
toString
-