Package com.tonic.analysis.frame
Class FrameGenerator
- java.lang.Object
-
- com.tonic.analysis.frame.FrameGenerator
-
public class FrameGenerator extends Object
Generates StackMapTable frames for a method.
-
-
Constructor Summary
Constructors Constructor Description FrameGenerator(ConstPool constPool)Constructs a FrameGenerator for the given constant pool.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<StackMapFrame>computeFrames(MethodEntry method)Computes the StackMapTable frames for a method.intcomputeMaxStack(MethodEntry method)Computes the truemax_stackover the method's control-flow graph.intgetMaxStack()The max operand-stack depth (slots) observed by the most recentcomputeFrames(com.tonic.parser.MethodEntry)/computeMaxStack(com.tonic.parser.MethodEntry)run.voidupdateStackMapTable(MethodEntry method)Convenience method to compute and update the StackMapTable for a method.
-
-
-
Constructor Detail
-
FrameGenerator
public FrameGenerator(ConstPool constPool)
Constructs a FrameGenerator for the given constant pool.- Parameters:
constPool- the constant pool
-
-
Method Detail
-
computeFrames
public List<StackMapFrame> computeFrames(MethodEntry method)
Computes the StackMapTable frames for a method.- Parameters:
method- The method to compute frames for- Returns:
- List of StackMapFrame entries (all FullFrame type)
-
computeMaxStack
public int computeMaxStack(MethodEntry method)
Computes the truemax_stackover the method's control-flow graph.- Parameters:
method- the method to analyze- Returns:
- the CFG-correct max_stack in slots (0 if the method has no code)
-
getMaxStack
public int getMaxStack()
The max operand-stack depth (slots) observed by the most recentcomputeFrames(com.tonic.parser.MethodEntry)/computeMaxStack(com.tonic.parser.MethodEntry)run.- Returns:
- the observed peak stack depth in slots
-
updateStackMapTable
public void updateStackMapTable(MethodEntry method)
Convenience method to compute and update the StackMapTable for a method.- Parameters:
method- The method to update
-
-