Class LocalVariableInfo

java.lang.Object
org.ek9lang.compiler.backend.jvm.support.LocalVariableInfo

public final class LocalVariableInfo extends Object
Metadata for a local variable needed for LocalVariableTable generation.

Tracks the variable name, type descriptor, scope, and JVM slot for generating debug information that enables jdb's 'locals' command.

The optional declaration label is the bytecode position immediately after the variable's null-init store (WP-B.2). Used as the LocalVariableTable range START so the range begins where the slot is verifier-defined — rather than at method entry, which made every local claim the method-wide range [0,end) and threw InconsistentDebugInfoException on a read-before-store (defect B-1).

  • Constructor Details

    • LocalVariableInfo

      public LocalVariableInfo(String name, String typeDescriptor, String scopeId)
      Create local variable info.
      Parameters:
      name - Variable name
      typeDescriptor - JVM type descriptor
      scopeId - Scope identifier (may be null for method parameters)
  • Method Details

    • getName

      public String getName()
    • getTypeDescriptor

      public String getTypeDescriptor()
    • getScopeId

      public String getScopeId()
    • getSlot

      public int getSlot()
    • setSlot

      public void setSlot(int slot)
    • getDeclarationLabel

      public org.objectweb.asm.Label getDeclarationLabel()
      The bytecode position after this variable's null-init store, or null for a parameter (which is live from method entry) or an uninstrumented compile. WP-B.2 range start.
    • setDeclarationLabel

      public void setDeclarationLabel(org.objectweb.asm.Label declarationLabel)