Module org.kink_lang.kink
Interface LvarAccessGenerator
- All Known Implementing Classes:
FastLvarAccessGenerator,SlowLvarAccessGenerator
public interface LvarAccessGenerator
Generates insns to access local vars.
-
Method Summary
Modifier and TypeMethodDescriptioncheckNull(String lvarName, Location loc, KeyStrSupplier keySup, TraceAccumulator traceAccum) If contParam is null, transition to raise and return.booleanReturns whetherlvaris unused.Generates insns to load a local var, checking absence.loadLvarAllowNull(LocalVar lvar) Generates insns to load a local var, not checking absence.Generates insns to pass the specified arg.Generates insns to pass the recv.Generates insns to store a local var.
-
Method Details
-
loadLvar
Generates insns to load a local var, checking absence.- Parameters:
lvar- the local var.loc- the location of the dereference.- Returns:
- insns to load a local var.
-
loadLvarAllowNull
Generates insns to load a local var, not checking absence.- Parameters:
lvar- the local var.- Returns:
- insns to load a local var.
-
storeLvar
Generates insns to store a local var.- Parameters:
lvar- the local var.- Returns:
- insns to store a local var.
-
passRecv
Generates insns to pass the recv.- Parameters:
lvar- the local var.- Returns:
- insns to pass recv.
-
passArg
Generates insns to pass the specified arg.- Parameters:
lvar- the local var.argIndex- the index of the arg.- Returns:
- insns to pass arg.
-
isUnused
Returns whetherlvaris unused.- Parameters:
lvar- local var to test.- Returns:
- whether lvar is unused.
-
checkNull
static List<Insn> checkNull(String lvarName, Location loc, KeyStrSupplier keySup, TraceAccumulator traceAccum) If contParam is null, transition to raise and return.- Parameters:
lvarName- the name of the local var.loc- the location of dereference.keySup- key str supplier.traceAccum- trace accumulator.- Returns:
- insns.
-