Package com.strobel.assembler.ir
Class StackMappingVisitor
- java.lang.Object
-
- com.strobel.assembler.ir.StackMappingVisitor
-
- All Implemented Interfaces:
MethodVisitor
public class StackMappingVisitor extends java.lang.Object implements MethodVisitor
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
StackMappingVisitor.InstructionAnalyzer
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<Instruction,TypeReference>
_initializations
private MethodVisitor
_innerVisitor
private java.util.List<FrameValue>
_locals
private int
_maxLocals
private java.util.List<FrameValue>
_stack
-
Constructor Summary
Constructors Constructor Description StackMappingVisitor()
StackMappingVisitor(MethodVisitor innerVisitor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Frame
buildFrame()
boolean
canVisitBody()
protected FrameValue
get(int local)
java.util.Map<Instruction,TypeReference>
getInitializations()
int
getLocalCount()
FrameValue[]
getLocalsSnapshot()
FrameValue
getLocalValue(int slot)
int
getStackSize()
FrameValue[]
getStackSnapshot()
FrameValue
getStackValue(int offset)
protected void
initialize(FrameValue value, TypeReference type)
protected FrameValue
peek()
protected FrameValue
pop()
protected void
pop(int count)
void
pruneLocals()
protected void
push(FrameValue value)
protected void
push(TypeReference type)
protected void
set(int local, FrameValue value)
protected void
set(int local, TypeReference type)
void
visitAnnotation(CustomAnnotation annotation, boolean visible)
void
visitAttribute(SourceAttribute attribute)
InstructionVisitor
visitBody(MethodBody body)
void
visitEnd()
void
visitFrame(Frame frame)
void
visitLineNumber(Instruction instruction, int lineNumber)
void
visitParameterAnnotation(int parameter, CustomAnnotation annotation, boolean visible)
-
-
-
Field Detail
-
_innerVisitor
private final MethodVisitor _innerVisitor
-
_maxLocals
private int _maxLocals
-
_stack
private java.util.List<FrameValue> _stack
-
_locals
private java.util.List<FrameValue> _locals
-
_initializations
private java.util.Map<Instruction,TypeReference> _initializations
-
-
Constructor Detail
-
StackMappingVisitor
public StackMappingVisitor()
-
StackMappingVisitor
public StackMappingVisitor(MethodVisitor innerVisitor)
-
-
Method Detail
-
buildFrame
public final Frame buildFrame()
-
getStackSize
public final int getStackSize()
-
getLocalCount
public final int getLocalCount()
-
getStackValue
public final FrameValue getStackValue(int offset)
-
getLocalValue
public final FrameValue getLocalValue(int slot)
-
getInitializations
public final java.util.Map<Instruction,TypeReference> getInitializations()
-
getStackSnapshot
public final FrameValue[] getStackSnapshot()
-
getLocalsSnapshot
public final FrameValue[] getLocalsSnapshot()
-
canVisitBody
public boolean canVisitBody()
- Specified by:
canVisitBody
in interfaceMethodVisitor
-
visitBody
public InstructionVisitor visitBody(MethodBody body)
- Specified by:
visitBody
in interfaceMethodVisitor
-
visitEnd
public void visitEnd()
- Specified by:
visitEnd
in interfaceMethodVisitor
-
visitFrame
public void visitFrame(Frame frame)
- Specified by:
visitFrame
in interfaceMethodVisitor
-
visitLineNumber
public void visitLineNumber(Instruction instruction, int lineNumber)
- Specified by:
visitLineNumber
in interfaceMethodVisitor
-
visitAttribute
public void visitAttribute(SourceAttribute attribute)
- Specified by:
visitAttribute
in interfaceMethodVisitor
-
visitAnnotation
public void visitAnnotation(CustomAnnotation annotation, boolean visible)
- Specified by:
visitAnnotation
in interfaceMethodVisitor
-
visitParameterAnnotation
public void visitParameterAnnotation(int parameter, CustomAnnotation annotation, boolean visible)
- Specified by:
visitParameterAnnotation
in interfaceMethodVisitor
-
get
protected final FrameValue get(int local)
-
set
protected final void set(int local, FrameValue value)
-
set
protected final void set(int local, TypeReference type)
-
pop
protected final FrameValue pop()
-
peek
protected final FrameValue peek()
-
pop
protected final void pop(int count)
-
push
protected final void push(TypeReference type)
-
push
protected final void push(FrameValue value)
-
initialize
protected void initialize(FrameValue value, TypeReference type)
-
pruneLocals
public void pruneLocals()
-
-