Package org.ek9lang.compiler.backend.jvm.support


package org.ek9lang.compiler.backend.jvm.support
JVM Backend Support Utilities - Extracted utilities for bytecode generation.

This package contains focused utility classes extracted from the AbstractAsmGenerator base class, following the EK9 pattern of small, single-responsibility classes.

Context and State:

Bytecode Generation:

These utilities are composed by AbstractAsmGenerator and used by the specialized AsmGenerator subclasses.

  • Class
    Description
    Generates debug information for JVM bytecode.
    THE closed taxonomy of EK9 compiler-generated method kinds carried by the Ek9MethodKinds class attribute (C.2), each with its debugger MethodDebugPolicy bitset.
    The versioned Ek9MethodKinds class attribute (C.2): a per-method map of (name, descriptor) -> Ek9MethodKind + MethodDebugPolicy bitset, letting the EK9 debug semantics layer decide step-filtering and frame re-presentation.
    One per-method record: the method (name, descriptor), the Ek9MethodKind wire kindCode, and its MethodDebugPolicy bitset.
    THE ACC_SYNTHETIC gate (C.1) on a MethodDebugPolicy bitset: a generated method is marked synthetic iff its policy is exactly hide-always.
    THE test of whether typeName is an EK9/Java primitive type (uses the I/L/F/D-family opcodes rather than the reference A-family).
    The JVM class-file version every generator stamps (JvmOpcodes.CLASS_FILE_VERSION).
    Generates JVM bytecode for EK9 literal values.
    THE JVM local-variable LOAD opcode for a type (ALOAD for object/reference types and null) - single-sources the per-type opcode switch the generators had duplicated.
    Metadata for a local variable needed for LocalVariableTable generation.
    Shared context for a method that must be coordinated across all generators.
    THE debugger step-filter / frame-decoder policy bits carried per generated method by the Ek9MethodKinds class attribute (C.2).
    THE key of a method in the Ek9MethodKinds attribute: its name and descriptor, space separated.
    Per-class accumulator of Ek9MethodKind entries, populated as methods are emitted and turned into the Ek9MethodKinds class attribute just before visitEnd() (mirroring how the SMAP is collected then attached).
    THE push of an int constant onto the operand stack using the most compact instruction: ICONST_M1..ICONST_5 for -1..5, BIPUSH for a byte, SIPUSH for a short, otherwise LDC - the ladder several generators had duplicated.
    THE void-returning constructor descriptor over reference-type parameters, given their JVM internal names: (LfirstParam;LrestParam0;...)V.
    Scope boundary information for tracking variable lifetimes.
    Support for stack-oriented code generation.
    THE JVM local-variable STORE opcode for a type (ASTORE for object/reference types) - single-sources the per-type opcode switch the generators had duplicated.
    THE C.1 ACC_SYNTHETIC gate: the extra access bit a generated method carries iff its kind is hide-always.
    Represents the source of a temp variable for stack-oriented code generation.
    The type of source for a temp variable.
    Generates JVM bytecode for variable load and store operations.