Class ScopeInstrAsmGenerator

java.lang.Object
org.ek9lang.compiler.backend.jvm.AbstractAsmGenerator
org.ek9lang.compiler.backend.jvm.ScopeInstrAsmGenerator
All Implemented Interfaces:
Consumer<ScopeInstr>

public final class ScopeInstrAsmGenerator extends AbstractAsmGenerator implements Consumer<ScopeInstr>
Specialized ASM generator for ScopeInstr processing. Handles SCOPE_ENTER, SCOPE_EXIT, and SCOPE_REGISTER operations.

While JVM doesn't need explicit scope management for memory (GC handles that), scopes are critical for: - LocalVariableTable generation (debug information) - Variable lifetime tracking for debuggers - Proper variable visibility in nested blocks (if/else/switch/for/try)

  • Constructor Details

    • ScopeInstrAsmGenerator

      public ScopeInstrAsmGenerator(ConstructTargetTuple constructTargetTuple, OutputVisitor outputVisitor, org.objectweb.asm.ClassWriter classWriter)
  • Method Details

    • accept

      public void accept(ScopeInstr scopeInstr)
      Generate JVM bytecode for a scope operation instruction. Uses ScopeInstr opcode to determine the specific operation.
      Specified by:
      accept in interface Consumer<ScopeInstr>