Class MethodKindTable
java.lang.Object
org.ek9lang.compiler.backend.jvm.support.MethodKindTable
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). One instance per generated class.
Both emission layers feed the same table: IR-funnel methods (keyed on their MethodSymbol)
and generator-invented, symbol-less methods (each generator records its own). See
docs/strategic/EK9_DEBUGGER_STRATEGY.md §18.4.
Keyed by (name, descriptor) with last-record-wins: when both layers classify the same
method (e.g. iterator() is retro-marked ENUM_OP then re-classified
ENUM_ITERATOR, §18.2), the later record(...) overrides — so exactly one wire entry
per method, never a conflicting pair. Insertion order is preserved for stable golden output.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidattachTo(org.objectweb.asm.ClassWriter classWriter) Attach the accumulated kinds as theEk9MethodKindsclass attribute, iff any were recorded.booleanisEmpty()voidrecord(String name, String descriptor, Ek9MethodKind kind) Record a generated method's kind (last-wins per name+descriptor).static intsyntheticFlag(Ek9MethodKind kind) THE C.1ACC_SYNTHETICgate: the extra access bit a generated method carries iff its kind ishide-always.Build the attribute to attach viaclassWriter.visitAttribute(...)before visitEnd.
-
Constructor Details
-
MethodKindTable
public MethodKindTable()
-
-
Method Details
-
record
Record a generated method's kind (last-wins per name+descriptor). Ordinary user-code methods are simply never recorded. -
isEmpty
public boolean isEmpty() -
toAttribute
Build the attribute to attach viaclassWriter.visitAttribute(...)before visitEnd. -
attachTo
public void attachTo(org.objectweb.asm.ClassWriter classWriter) Attach the accumulated kinds as theEk9MethodKindsclass attribute, iff any were recorded. Call this once, immediately beforeclassWriter.visitEnd()(the same slot the SMAP is attached). A class with no generated methods contributes no attribute. -
syntheticFlag
THE C.1ACC_SYNTHETICgate: the extra access bit a generated method carries iff its kind ishide-always. OR this into the base access flags atvisitMethodtime. Returns 0 for a null kind (user code) or anystep-on-request/show-representedkind - marking those synthetic would make a "skip synthetic" debugger hide the user's own code (strategy §18.4 conclusion 1). This is the ONLY place the kind → JVM-bit mapping is made.
-