public class JsonPrinter extends java.lang.Object implements PartialEvaluatorStateTracker
Constructor and Description |
---|
JsonPrinter() |
JsonPrinter(Clazz clazzFilter) |
JsonPrinter(Clazz clazzFilter,
Method methodFilter) |
Modifier and Type | Method and Description |
---|---|
void |
endSubroutine(Clazz clazz,
Method method,
TracedVariables variablesAfter,
TracedStack stackAfter,
int subroutineStart,
int subroutineEnd)
The evaluation and generalization of the subroutine is done, the partial evaluator moves on.
|
void |
evaluationResults(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
PartialEvaluator evaluator)
Partial evaluator is done evaluating the code attribute.
|
void |
generalizeInstructionBlock(Clazz clazz,
Method method,
int instructionOffset,
Instruction instruction,
TracedVariables variablesBefore,
TracedStack stackBefore,
int evaluationCount)
The instruction has been seen a certain number of times and the evaluator deems it time to
start generalizing the instruction.
|
java.lang.String |
getJson() |
void |
printState() |
void |
registerAlternativeBranch(Clazz clazz,
Method method,
int fromInstructionOffset,
Instruction fromInstruction,
TracedVariables variablesAfter,
TracedStack stackAfter,
int branchIndex,
int branchTargetCount,
int offset)
The evaluator detects multiple branches need to be evaluated.
|
void |
registerException(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
PartialEvaluator evaluator,
java.lang.Throwable cause)
An exception has been thrown while evaluating the current code attribute.
|
void |
registerExceptionHandler(Clazz clazz,
Method method,
int startPC,
int endPC,
ExceptionInfo info)
Partial evaluator starts evaluating a specific exception handler.
|
void |
registerSubroutineReturn(Clazz clazz,
Method method,
int returnOffset,
TracedVariables returnVariables,
TracedStack returnStack)
The current instruction was RET and the partial evaluator pushes the return address to the
branch stack of the calling partial evaluator.
|
void |
skipInstructionBlock(Clazz clazz,
Method method,
int instructionOffset,
Instruction instruction,
TracedVariables variablesBefore,
TracedStack stackBefore,
int evaluationCount)
The instruction within this instruction block has been seen with the those variables and this
stack, and thus it is not needed to evaluate this block any further.
|
void |
startCodeAttribute(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
Variables parameters)
The partial evaluator starts with the evaluation of a code block.
|
void |
startInstructionBlock(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
TracedVariables startVariables,
TracedStack startStack,
int startOffset)
Partial evaluator starts evaluating an instruction block, specified by an instruction range
within the code attribute and the variables and stack it would start with.
|
void |
startInstructionEvaluation(Clazz clazz,
Method method,
int instructionOffset,
Instruction instruction,
TracedVariables variablesBefore,
TracedStack stackBefore,
int evaluationCount)
The partial evaluator will forward the evaluation of the instruction.
|
void |
startSubroutine(Clazz clazz,
Method method,
TracedVariables startVariables,
TracedStack startStack,
int subroutineStart,
int subroutineEnd)
The current instruction was JSR or JSR_W and the partial evaluator starts with the evaluation
of the subroutine.
|
void |
writeState(java.lang.String fileName) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
afterInstructionEvaluation, definitiveBranch, generalizeSubroutine, instructionBlockDone, registerUnusedExceptionHandler, startBranchCodeBlockEvaluation, startExceptionHandlingForBlock
public JsonPrinter()
public JsonPrinter(Clazz clazzFilter)
public java.lang.String getJson()
public void printState()
public void writeState(java.lang.String fileName)
public void startCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, Variables parameters)
PartialEvaluatorStateTracker
startCodeAttribute
in interface PartialEvaluatorStateTracker
public void registerException(Clazz clazz, Method method, CodeAttribute codeAttribute, PartialEvaluator evaluator, java.lang.Throwable cause)
PartialEvaluatorStateTracker
registerException
in interface PartialEvaluatorStateTracker
public void registerExceptionHandler(Clazz clazz, Method method, int startPC, int endPC, ExceptionInfo info)
PartialEvaluatorStateTracker
registerExceptionHandler
in interface PartialEvaluatorStateTracker
public void evaluationResults(Clazz clazz, Method method, CodeAttribute codeAttribute, PartialEvaluator evaluator)
PartialEvaluatorStateTracker
evaluationResults
in interface PartialEvaluatorStateTracker
public void startInstructionBlock(Clazz clazz, Method method, CodeAttribute codeAttribute, TracedVariables startVariables, TracedStack startStack, int startOffset)
PartialEvaluatorStateTracker
startInstructionBlock
in interface PartialEvaluatorStateTracker
public void skipInstructionBlock(Clazz clazz, Method method, int instructionOffset, Instruction instruction, TracedVariables variablesBefore, TracedStack stackBefore, int evaluationCount)
PartialEvaluatorStateTracker
skipInstructionBlock
in interface PartialEvaluatorStateTracker
public void generalizeInstructionBlock(Clazz clazz, Method method, int instructionOffset, Instruction instruction, TracedVariables variablesBefore, TracedStack stackBefore, int evaluationCount)
PartialEvaluatorStateTracker
generalizeInstructionBlock
in interface PartialEvaluatorStateTracker
public void startInstructionEvaluation(Clazz clazz, Method method, int instructionOffset, Instruction instruction, TracedVariables variablesBefore, TracedStack stackBefore, int evaluationCount)
PartialEvaluatorStateTracker
startInstructionEvaluation
in interface PartialEvaluatorStateTracker
public void registerAlternativeBranch(Clazz clazz, Method method, int fromInstructionOffset, Instruction fromInstruction, TracedVariables variablesAfter, TracedStack stackAfter, int branchIndex, int branchTargetCount, int offset)
PartialEvaluatorStateTracker
registerAlternativeBranch
in interface PartialEvaluatorStateTracker
public void startSubroutine(Clazz clazz, Method method, TracedVariables startVariables, TracedStack startStack, int subroutineStart, int subroutineEnd)
PartialEvaluatorStateTracker
startSubroutine
in interface PartialEvaluatorStateTracker
public void registerSubroutineReturn(Clazz clazz, Method method, int returnOffset, TracedVariables returnVariables, TracedStack returnStack)
PartialEvaluatorStateTracker
registerSubroutineReturn
in interface PartialEvaluatorStateTracker
public void endSubroutine(Clazz clazz, Method method, TracedVariables variablesAfter, TracedStack stackAfter, int subroutineStart, int subroutineEnd)
PartialEvaluatorStateTracker
endSubroutine
in interface PartialEvaluatorStateTracker