Package com.tonic.analysis.ssa.lower
Class LocalVariableTableBuilder
- java.lang.Object
-
- com.tonic.analysis.ssa.lower.LocalVariableTableBuilder
-
public final class LocalVariableTableBuilder extends Object
A builder for aLocalVariableTableover the source-local model recorded during AST lowering (IRMethod.SourceLocal), taking slots fromRegisterAllocatorand scoping each entry to the blocks holding that local's defs and uses.
-
-
Constructor Summary
Constructors Constructor Description LocalVariableTableBuilder(IRMethod irMethod, RegisterAllocator regAlloc, BytecodeEmitter emitter, int codeLength, ConstPool constPool, MethodEntry targetMethod)Creates a builder over one lowered method.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LocalVariableTableAttributebuild()Builds the attribute, emitting one entry per slot a local occupies so that a variable whose versions landed on different slots does not over-reach into its neighbours' scopes.Map<Long,String>getSignaturesByLvKey()
-
-
-
Constructor Detail
-
LocalVariableTableBuilder
public LocalVariableTableBuilder(IRMethod irMethod, RegisterAllocator regAlloc, BytecodeEmitter emitter, int codeLength, ConstPool constPool, MethodEntry targetMethod)
Creates a builder over one lowered method.- Parameters:
irMethod- the method whose source-local records supply names and declared typesregAlloc- the final register allocation, which owns the two-slot long/double accountingemitter- the emitter holding the written slots and store end offsets of the final layoutcodeLength- length in bytes of the emitted code, used as the scope end for parametersconstPool- pool the name and descriptor Utf8 entries are added totargetMethod- the method the attribute will be attached to
-
-
Method Detail
-
build
public LocalVariableTableAttribute build()
Builds the attribute, emitting one entry per slot a local occupies so that a variable whose versions landed on different slots does not over-reach into its neighbours' scopes.- Returns:
- the built attribute, or null when the method carries no source-local model
-
-