Class PrimitiveLiteralAsmGenerator
java.lang.Object
org.ek9lang.compiler.backend.jvm.AbstractAsmGenerator
org.ek9lang.compiler.backend.jvm.PrimitiveLiteralAsmGenerator
- All Implemented Interfaces:
Consumer<PrimitiveLiteralInstr>
final class PrimitiveLiteralAsmGenerator
extends AbstractAsmGenerator
implements Consumer<PrimitiveLiteralInstr>
Specialized ASM generator for PrimitiveLiteralInstr processing.
Handles loading of primitive values (int, boolean, java.lang.String) directly
onto the JVM stack without creating EK9 wrapper objects.
Generated bytecode:
- int: BIPUSH/SIPUSH/LDC depending on value magnitude
- boolean: ICONST_0/ICONST_1
- java.lang.String: LDC (String constant pool entry)
-
Field Summary
Fields inherited from class AbstractAsmGenerator
classWriter, constructTargetTuple, outputVisitor -
Constructor Summary
ConstructorsConstructorDescriptionPrimitiveLiteralAsmGenerator(ConstructTargetTuple constructTargetTuple, OutputVisitor outputVisitor, org.objectweb.asm.ClassWriter classWriter) -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(PrimitiveLiteralInstr primitiveLiteralInstr) Generate JVM bytecode for a primitive literal loading instruction.Methods inherited from class AbstractAsmGenerator
convertToJvmDescriptor, convertToJvmName, extractFieldName, generateBooleanLiteral, generateCharacterLiteral, generateDebugInfo, generateFloatLiteral, generateIntegerLiteral, generateLoadVariable, generateLocalVariableTable, generateMethodDescriptor, generateObjectLiteral, generateStackOperation, generateStoreVariable, generateStringLiteral, getCurrentMethodVisitor, getFieldDescriptor, getMethodContext, getOrCreateLabel, getOwnerClassName, getVariableIndex, isFieldAccess, isVariableAllocated, isVariableFieldAccess, setCurrentMethodVisitor, setSharedMethodContext, trackTempVariableFromLiteral, trackTempVariableFromLoad
-
Constructor Details
-
PrimitiveLiteralAsmGenerator
PrimitiveLiteralAsmGenerator(ConstructTargetTuple constructTargetTuple, OutputVisitor outputVisitor, org.objectweb.asm.ClassWriter classWriter)
-
-
Method Details
-
accept
Generate JVM bytecode for a primitive literal loading instruction. Loads primitive values directly onto the stack.- Specified by:
acceptin interfaceConsumer<PrimitiveLiteralInstr>
-