Module org.kink_lang.kink
Class SlowLvarAccessGenerator
java.lang.Object
org.kink_lang.kink.internal.compile.javaclassir.SlowLvarAccessGenerator
- All Implemented Interfaces:
LvarAccessGenerator
Generates access to local vars of slow funs.
-
Constructor Summary
ConstructorDescriptionSlowLvarAccessGenerator
(Vm vm, BindingGenerator bindingGen, KeyStrSupplier keySup, TraceAccumulator traceAccum) Constructs a generator. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns whetherlvar
is 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.
-
Constructor Details
-
SlowLvarAccessGenerator
public SlowLvarAccessGenerator(Vm vm, BindingGenerator bindingGen, KeyStrSupplier keySup, TraceAccumulator traceAccum) Constructs a generator.- Parameters:
vm
- the vm.bindingGen
- generates binding.keySup
- the key str supplier.traceAccum
- the trace accumulator.
-
-
Method Details
-
loadLvar
Description copied from interface:LvarAccessGenerator
Generates insns to load a local var, checking absence.- Specified by:
loadLvar
in interfaceLvarAccessGenerator
- Parameters:
lvar
- the local var.loc
- the location of the dereference.- Returns:
- insns to load a local var.
-
loadLvarAllowNull
Description copied from interface:LvarAccessGenerator
Generates insns to load a local var, not checking absence.- Specified by:
loadLvarAllowNull
in interfaceLvarAccessGenerator
- Parameters:
lvar
- the local var.- Returns:
- insns to load a local var.
-
storeLvar
Description copied from interface:LvarAccessGenerator
Generates insns to store a local var.- Specified by:
storeLvar
in interfaceLvarAccessGenerator
- Parameters:
lvar
- the local var.- Returns:
- insns to store a local var.
-
passRecv
Description copied from interface:LvarAccessGenerator
Generates insns to pass the recv.- Specified by:
passRecv
in interfaceLvarAccessGenerator
- Parameters:
lvar
- the local var.- Returns:
- insns to pass recv.
-
passArg
Description copied from interface:LvarAccessGenerator
Generates insns to pass the specified arg.- Specified by:
passArg
in interfaceLvarAccessGenerator
- Parameters:
lvar
- the local var.argIndex
- the index of the arg.- Returns:
- insns to pass arg.
-
isUnused
Description copied from interface:LvarAccessGenerator
Returns whetherlvar
is unused.- Specified by:
isUnused
in interfaceLvarAccessGenerator
- Parameters:
lvar
- local var to test.- Returns:
- whether lvar is unused.
-