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 classStackMappingVisitor.InstructionAnalyzer
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<Instruction,TypeReference>_initializationsprivate MethodVisitor_innerVisitorprivate java.util.List<FrameValue>_localsprivate int_maxLocalsprivate 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 FramebuildFrame()booleancanVisitBody()protected FrameValueget(int local)java.util.Map<Instruction,TypeReference>getInitializations()intgetLocalCount()FrameValue[]getLocalsSnapshot()FrameValuegetLocalValue(int slot)intgetStackSize()FrameValue[]getStackSnapshot()FrameValuegetStackValue(int offset)protected voidinitialize(FrameValue value, TypeReference type)protected FrameValuepeek()protected FrameValuepop()protected voidpop(int count)voidpruneLocals()protected voidpush(FrameValue value)protected voidpush(TypeReference type)protected voidset(int local, FrameValue value)protected voidset(int local, TypeReference type)voidvisitAnnotation(CustomAnnotation annotation, boolean visible)voidvisitAttribute(SourceAttribute attribute)InstructionVisitorvisitBody(MethodBody body)voidvisitEnd()voidvisitFrame(Frame frame)voidvisitLineNumber(Instruction instruction, int lineNumber)voidvisitParameterAnnotation(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:
canVisitBodyin interfaceMethodVisitor
-
visitBody
public InstructionVisitor visitBody(MethodBody body)
- Specified by:
visitBodyin interfaceMethodVisitor
-
visitEnd
public void visitEnd()
- Specified by:
visitEndin interfaceMethodVisitor
-
visitFrame
public void visitFrame(Frame frame)
- Specified by:
visitFramein interfaceMethodVisitor
-
visitLineNumber
public void visitLineNumber(Instruction instruction, int lineNumber)
- Specified by:
visitLineNumberin interfaceMethodVisitor
-
visitAttribute
public void visitAttribute(SourceAttribute attribute)
- Specified by:
visitAttributein interfaceMethodVisitor
-
visitAnnotation
public void visitAnnotation(CustomAnnotation annotation, boolean visible)
- Specified by:
visitAnnotationin interfaceMethodVisitor
-
visitParameterAnnotation
public void visitParameterAnnotation(int parameter, CustomAnnotation annotation, boolean visible)- Specified by:
visitParameterAnnotationin 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()
-
-