Package com.tonic.analysis.absexec
Class Execution
- java.lang.Object
-
- com.tonic.analysis.absexec.Execution
-
public final class Execution extends Object
A path-exploring abstract interpreter over one method's bytecode that builds operand-stack/local def-use (InsnContext/StackCtx/VarCtx) without an abstract value domain.
-
-
Constructor Summary
Constructors Constructor Description Execution(MethodEntry method)Builds an execution over the method's decoded instruction list.Execution(MethodEntry method, List<Instruction> insns)Builds an execution over a caller-provided instruction list.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExecutionaddVisitor(Consumer<InsnContext> v)Registers a visitor invoked for every executed instruction-context.voidrun()Explores the method from its entry frame until the work queue drains or the frame cap is hit.booleanwasExecuted(Instruction insn)Reports whether the interpreter reached the given instruction on any explored path.
-
-
-
Constructor Detail
-
Execution
public Execution(MethodEntry method)
Builds an execution over the method's decoded instruction list.- Parameters:
method- the method to interpret
-
Execution
public Execution(MethodEntry method, List<Instruction> insns)
Builds an execution over a caller-provided instruction list.- Parameters:
method- the method to interpretinsns- the decoded instruction list to interpret
-
-
Method Detail
-
addVisitor
public Execution addVisitor(Consumer<InsnContext> v)
Registers a visitor invoked for every executed instruction-context.- Parameters:
v- the visitor to add- Returns:
- this execution
-
run
public void run()
Explores the method from its entry frame until the work queue drains or the frame cap is hit.
-
wasExecuted
public boolean wasExecuted(Instruction insn)
Reports whether the interpreter reached the given instruction on any explored path.- Parameters:
insn- the instruction to test- Returns:
- true if the instruction was executed at least once
-
-