Class MethodKindIndex
java.lang.Object
org.ek9lang.compiler.backend.jvm.debug.MethodKindIndex
The debug-time reader of one class's
Ek9MethodKinds attribute (C.2): parses the class bytes
into a (method name + descriptor) -> Ek9MethodKind / MethodDebugPolicy
lookup. This is the INPUT half of the F.3 step filter - StepFilter turns the policy bits it
returns into stepping decisions. See docs/strategic/EK9_DEBUGGER_STRATEGY.md §18 and the F.3
row of docs/implementation/EK9_DEBUGGER_IMPLEMENTATION_PLAN.md.
Why read the bytes, not JDI. JDI's ReferenceType exposes fields/methods/source but
NOT arbitrary class attributes, so the semantics layer cannot ask JDWP "what is this method's kind".
It must read the .class bytes (from the .ek9 output the debuggee loaded) with ASM,
registering an Ek9MethodKindsAttribute prototype - exactly as the tagging tests do. One index
per class; the debug runtime will cache them per loaded ReferenceType.
The user-code default is the whole point. A method with no entry is ordinary user code, so
policyFor(String, String) returns MethodDebugPolicy.USER_CODE for it - fully shown, fully steppable.
That collapses "is this user code?" and "what does the tag say?" into ONE bit-test path in the
filter, with no special-casing.
-
Method Summary
Modifier and TypeMethodDescriptionThe JVM internal name of the class this index was read from (e.g.The recorded entry for a method, or empty when it has none (user code).static MethodKindIndexfromClassBytes(byte[] classBytes) Parse a class'sEk9MethodKindsattribute out of its raw bytes.booleanisEmpty()True when the class carried no tagged methods (nothing recorded ⇒ all user code).The recordedEk9MethodKindfor a method (drives frame re-presentation), or empty when the method is user code or the wire code is unknown to this version.intTHE step-filter input: theMethodDebugPolicybitset for a method, defaulting toMethodDebugPolicy.USER_CODEwhen the method has no entry (user code is fully shown/steppable).
-
Method Details
-
fromClassBytes
Parse a class'sEk9MethodKindsattribute out of its raw bytes. A class with no such attribute (all user code, or a non-EK9 class) yields an empty index - every lookup then falls back toMethodDebugPolicy.USER_CODE. -
className
The JVM internal name of the class this index was read from (e.g.bytecode/test/Point). -
isEmpty
public boolean isEmpty()True when the class carried no tagged methods (nothing recorded ⇒ all user code). -
entryFor
The recorded entry for a method, or empty when it has none (user code). Callers that only need the stepping decision should preferpolicyFor(String, String); the entry is for frame re-presentation, which also needs theEk9MethodKind. -
policyFor
THE step-filter input: theMethodDebugPolicybitset for a method, defaulting toMethodDebugPolicy.USER_CODEwhen the method has no entry (user code is fully shown/steppable). This is whatStepFilterconsumes. -
kindFor
The recordedEk9MethodKindfor a method (drives frame re-presentation), or empty when the method is user code or the wire code is unknown to this version.
-