use of org.freud.analysed.classbytecode.method.instruction.Instruction in project freud by LMAX-Exchange.
the class AsmMethod method visitTypeInsn.
public void visitTypeInsn(final int opcodeUsed, final String type) {
final Opcode opcode = OPCODES_ARRAY[opcodeUsed];
final String operandType = "L" + type + ";";
final Instruction instruction = new ReferenceOperandInstruction(instructionList.size(), opcode, currentLineNumber, operandType);
updateCurrentState(instruction);
}
use of org.freud.analysed.classbytecode.method.instruction.Instruction in project freud by LMAX-Exchange.
the class AsmMethod method visitJumpInsn.
public void visitJumpInsn(final int opcode, final org.objectweb.asm.Label asmLabel) {
Label label = declareLabel(asmLabel);
// System.out.println(name + " " + OPCODES_ARRAY[opcode] + " " + asmLabel + " " + label);
final Instruction instruction = new JumpInstruction(instructionList.size(), OPCODES_ARRAY[opcode], currentLineNumber, label);
updateCurrentState(instruction);
}
use of org.freud.analysed.classbytecode.method.instruction.Instruction in project freud by LMAX-Exchange.
the class AsmMethod method visitFieldInsn.
public void visitFieldInsn(final int opcode, final String owner, final String name, final String desc) {
final Instruction instruction = new FieldInstruction(instructionList.size(), OPCODES_ARRAY[opcode], currentLineNumber, owner, name, desc);
updateCurrentState(instruction);
}
use of org.freud.analysed.classbytecode.method.instruction.Instruction in project freud by LMAX-Exchange.
the class ClassByteCodeDsl method hasMethodInvocation.
public static boolean hasMethodInvocation(final ClassByteCodeMethod analysed, final Class expectedOwner, final String expectedMethodName, final Class... expectedParamsDeclared) {
final boolean[] found = new boolean[] { false };
final String expectedOwnerName = typeEncoding(expectedOwner);
final String[] expectedParamNames = (expectedParamsDeclared.length == 0) ? EMPTY_ARGS : new String[expectedParamsDeclared.length];
for (int i = 0, size = expectedParamsDeclared.length; i < size; i++) {
expectedParamNames[i] = typeEncoding(expectedParamsDeclared[i]);
}
found[0] = false;
analysed.findInstruction(new AbstractInstructionVisitor() {
@Override
public void methodInvocation(final Instruction instruction, final String owner, final String methodName, final String... args) {
if (!found[0] && expectedOwnerName.equals(owner) && expectedMethodName.equals(methodName) && Arrays.equals(expectedParamNames, args)) {
found[0] = true;
}
}
});
return found[0];
}
use of org.freud.analysed.classbytecode.method.instruction.Instruction in project freud by LMAX-Exchange.
the class AsmMethod method visitMultiANewArrayInsn.
public void visitMultiANewArrayInsn(final String desc, final int dims) {
final Instruction instruction = new ReferenceOperandInstruction(instructionList.size(), Opcode.MULTIANEWARRAY, currentLineNumber, desc, dims);
updateCurrentState(instruction);
}
Aggregations