public class Processor extends java.lang.Object implements InstructionVisitor
InstructionVisitor
executes the instructions that it visits on a given local
variable frame and stack.Constructor and Description |
---|
Processor(Variables variables,
Stack stack,
ValueFactory valueFactory,
BranchUnit branchUnit,
InvocationUnit invocationUnit,
boolean alwaysCast)
Creates a new processor that operates on the given environment.
|
Modifier and Type | Method and Description |
---|---|
void |
visitBranchInstruction(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
BranchInstruction branchInstruction) |
void |
visitConstantInstruction(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
ConstantInstruction constantInstruction) |
void |
visitLookUpSwitchInstruction(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
LookUpSwitchInstruction lookUpSwitchInstruction) |
void |
visitSimpleInstruction(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
SimpleInstruction simpleInstruction) |
void |
visitTableSwitchInstruction(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
TableSwitchInstruction tableSwitchInstruction) |
void |
visitVariableInstruction(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
VariableInstruction variableInstruction) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
visitAnyInstruction, visitAnySwitchInstruction
public Processor(Variables variables, Stack stack, ValueFactory valueFactory, BranchUnit branchUnit, InvocationUnit invocationUnit, boolean alwaysCast)
variables
- the local variable frame.stack
- the local stack.valueFactory
- the value factory that will create all values during the evaluation.branchUnit
- the class that can affect the program counter.invocationUnit
- the class that can access other program members.alwaysCast
- a flag that specifies whether downcasts or casts of null values should always
be performed.public void visitSimpleInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SimpleInstruction simpleInstruction)
visitSimpleInstruction
in interface InstructionVisitor
public void visitConstantInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, ConstantInstruction constantInstruction)
visitConstantInstruction
in interface InstructionVisitor
public void visitVariableInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, VariableInstruction variableInstruction)
visitVariableInstruction
in interface InstructionVisitor
public void visitBranchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, BranchInstruction branchInstruction)
visitBranchInstruction
in interface InstructionVisitor
public void visitTableSwitchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, TableSwitchInstruction tableSwitchInstruction)
visitTableSwitchInstruction
in interface InstructionVisitor
public void visitLookUpSwitchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, LookUpSwitchInstruction lookUpSwitchInstruction)
visitLookUpSwitchInstruction
in interface InstructionVisitor