Class CoverageRegisterInstr

java.lang.Object
org.ek9lang.compiler.ir.instructions.IRInstr
org.ek9lang.compiler.ir.instructions.CoverageRegisterInstr
All Implemented Interfaces:
INode

public final class CoverageRegisterInstr extends IRInstr
Specialized IR instruction for coverage module registration (COVERAGE_REGISTER).

This instruction is emitted in the static initializer of each covered class. It registers the module's coverage metadata with the runtime so that:

  • Probe arrays are allocated
  • Module metadata is recorded for reporting
  • Coverage data can be aggregated across modules
  • Method Details

    • register

      public static CoverageRegisterInstr register(CoverageModuleDetails moduleDetails, DebugInfo debugInfo)
      Create a coverage register instruction.
      Parameters:
      moduleDetails - Full module coverage metadata
      debugInfo - Optional source location debug info
    • register

      public static CoverageRegisterInstr register(long moduleId, String moduleName, int probeCount, DebugInfo debugInfo)
      Create a coverage register instruction with minimal details.
      Parameters:
      moduleId - The module ID
      moduleName - The module name
      probeCount - The total number of probes in this module
      debugInfo - Optional source location debug info
    • getModuleDetails

      public CoverageModuleDetails getModuleDetails()
      Get the full module details for this instruction.
    • getModuleId

      public long getModuleId()
      Get the module ID.
    • getModuleName

      public String getModuleName()
      Get the module name.
    • getProbeCount

      public int getProbeCount()
      Get the total probe count for this module.
    • accept

      public void accept(INodeVisitor visitor)
      Specified by:
      accept in interface INode
      Overrides:
      accept in class IRInstr
    • toString

      public String toString()
      Overrides:
      toString in class IRInstr