Package org.plumelib.bcelutil
Class StackTypes
java.lang.Object
org.plumelib.bcelutil.StackTypes
Stores the types on the stack at each instruction (identified by byte code offset) in a method.
-
Constructor Summary
ConstructorDescriptionStackTypes
(org.apache.bcel.generic.MethodGen mg) Create a record of the types on the stack at each instruction in a method. -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.bcel.verifier.structurals.OperandStack
get
(@org.checkerframework.checker.index.qual.IndexFor({"localVariableses", "operandStacks"}) int offset) Returns the stack contents at the specified offset.void
set
(@org.checkerframework.checker.index.qual.IndexFor({"localVariableses", "operandStacks"}) int offset, org.apache.bcel.verifier.structurals.Frame f) Sets the stack for the instruction at the specified offset to a copy of the information in the given frame.toString()
toString
(org.apache.bcel.verifier.structurals.LocalVariables lv) Return a printed representation of the given LocalVariables.toString
(org.apache.bcel.verifier.structurals.OperandStack os) Return a printed representation of the given OperandStack.
-
Constructor Details
-
StackTypes
public StackTypes(org.apache.bcel.generic.MethodGen mg) Create a record of the types on the stack at each instruction in a method. The created object starts out empty, with no type information.- Parameters:
mg
- the method
-
-
Method Details
-
set
public void set(@org.checkerframework.checker.index.qual.IndexFor({"localVariableses", "operandStacks"}) int offset, org.apache.bcel.verifier.structurals.Frame f) Sets the stack for the instruction at the specified offset to a copy of the information in the given frame.- Parameters:
offset
- the offset at which the instruction appearsf
- the stack frame to use for the instruction
-
get
public org.apache.bcel.verifier.structurals.OperandStack get(@org.checkerframework.checker.index.qual.IndexFor({"localVariableses", "operandStacks"}) int offset) Returns the stack contents at the specified offset.- Parameters:
offset
- the offset to which to get the stack contents- Returns:
- the stack at the (instruction at the) given offset
-
toString
-
toString
@SideEffectFree public String toString(@GuardSatisfied StackTypes this, org.apache.bcel.verifier.structurals.OperandStack os) Return a printed representation of the given OperandStack.- Parameters:
os
- the OperandStack to print- Returns:
- a printed representation of
os
-
toString
@SideEffectFree public String toString(@GuardSatisfied StackTypes this, org.apache.bcel.verifier.structurals.LocalVariables lv) Return a printed representation of the given LocalVariables.- Parameters:
lv
- the LocalVariablesStack to print- Returns:
- a printed representation of
lv
-