Search in sources :

Example 1 with ReferenceOperandInstruction

use of org.freud.analysed.classbytecode.method.instruction.ReferenceOperandInstruction 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);
}
Also used : ReferenceOperandInstruction(org.freud.analysed.classbytecode.method.instruction.ReferenceOperandInstruction) Opcode(org.freud.analysed.classbytecode.method.instruction.Opcode) Instruction(org.freud.analysed.classbytecode.method.instruction.Instruction) ReferenceOperandInstruction(org.freud.analysed.classbytecode.method.instruction.ReferenceOperandInstruction) VarInstruction(org.freud.analysed.classbytecode.method.instruction.VarInstruction) JumpInstruction(org.freud.analysed.classbytecode.method.instruction.JumpInstruction) ConstInstruction(org.freud.analysed.classbytecode.method.instruction.ConstInstruction) FieldInstruction(org.freud.analysed.classbytecode.method.instruction.FieldInstruction) IntOperandInstruction(org.freud.analysed.classbytecode.method.instruction.IntOperandInstruction) MethodInvocationInstruction(org.freud.analysed.classbytecode.method.instruction.MethodInvocationInstruction)

Example 2 with ReferenceOperandInstruction

use of org.freud.analysed.classbytecode.method.instruction.ReferenceOperandInstruction 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);
}
Also used : ReferenceOperandInstruction(org.freud.analysed.classbytecode.method.instruction.ReferenceOperandInstruction) Instruction(org.freud.analysed.classbytecode.method.instruction.Instruction) ReferenceOperandInstruction(org.freud.analysed.classbytecode.method.instruction.ReferenceOperandInstruction) VarInstruction(org.freud.analysed.classbytecode.method.instruction.VarInstruction) JumpInstruction(org.freud.analysed.classbytecode.method.instruction.JumpInstruction) ConstInstruction(org.freud.analysed.classbytecode.method.instruction.ConstInstruction) FieldInstruction(org.freud.analysed.classbytecode.method.instruction.FieldInstruction) IntOperandInstruction(org.freud.analysed.classbytecode.method.instruction.IntOperandInstruction) MethodInvocationInstruction(org.freud.analysed.classbytecode.method.instruction.MethodInvocationInstruction)

Example 3 with ReferenceOperandInstruction

use of org.freud.analysed.classbytecode.method.instruction.ReferenceOperandInstruction in project freud by LMAX-Exchange.

the class AsmMethod method visitIntInsn.

public void visitIntInsn(final int opcodeUsed, final int operand) {
    final Opcode opcode = OPCODES_ARRAY[opcodeUsed];
    final Instruction instruction;
    if (opcode == Opcode.NEWARRAY) {
        instruction = new ReferenceOperandInstruction(instructionList.size(), opcode, currentLineNumber, NEWARRAY_TYPES[operand]);
    } else {
        instruction = new IntOperandInstruction(instructionList.size(), opcode, currentLineNumber, operand);
    }
    updateCurrentState(instruction);
}
Also used : IntOperandInstruction(org.freud.analysed.classbytecode.method.instruction.IntOperandInstruction) ReferenceOperandInstruction(org.freud.analysed.classbytecode.method.instruction.ReferenceOperandInstruction) Opcode(org.freud.analysed.classbytecode.method.instruction.Opcode) Instruction(org.freud.analysed.classbytecode.method.instruction.Instruction) ReferenceOperandInstruction(org.freud.analysed.classbytecode.method.instruction.ReferenceOperandInstruction) VarInstruction(org.freud.analysed.classbytecode.method.instruction.VarInstruction) JumpInstruction(org.freud.analysed.classbytecode.method.instruction.JumpInstruction) ConstInstruction(org.freud.analysed.classbytecode.method.instruction.ConstInstruction) FieldInstruction(org.freud.analysed.classbytecode.method.instruction.FieldInstruction) IntOperandInstruction(org.freud.analysed.classbytecode.method.instruction.IntOperandInstruction) MethodInvocationInstruction(org.freud.analysed.classbytecode.method.instruction.MethodInvocationInstruction)

Example 4 with ReferenceOperandInstruction

use of org.freud.analysed.classbytecode.method.instruction.ReferenceOperandInstruction in project freud by LMAX-Exchange.

the class AsmMethod method visitLdcInsn.

public void visitLdcInsn(final Object constant) {
    final Instruction instruction;
    if (constant instanceof Type) {
        instruction = new ReferenceOperandInstruction(instructionList.size(), Opcode.LDC, currentLineNumber, constant.toString());
    } else {
        instruction = new ConstInstruction(instructionList.size(), Opcode.LDC, currentLineNumber, constant);
    }
    updateCurrentState(instruction);
}
Also used : ConstInstruction(org.freud.analysed.classbytecode.method.instruction.ConstInstruction) Type(org.objectweb.asm.Type) ReferenceOperandInstruction(org.freud.analysed.classbytecode.method.instruction.ReferenceOperandInstruction) Instruction(org.freud.analysed.classbytecode.method.instruction.Instruction) ReferenceOperandInstruction(org.freud.analysed.classbytecode.method.instruction.ReferenceOperandInstruction) VarInstruction(org.freud.analysed.classbytecode.method.instruction.VarInstruction) JumpInstruction(org.freud.analysed.classbytecode.method.instruction.JumpInstruction) ConstInstruction(org.freud.analysed.classbytecode.method.instruction.ConstInstruction) FieldInstruction(org.freud.analysed.classbytecode.method.instruction.FieldInstruction) IntOperandInstruction(org.freud.analysed.classbytecode.method.instruction.IntOperandInstruction) MethodInvocationInstruction(org.freud.analysed.classbytecode.method.instruction.MethodInvocationInstruction)

Aggregations

ConstInstruction (org.freud.analysed.classbytecode.method.instruction.ConstInstruction)4 FieldInstruction (org.freud.analysed.classbytecode.method.instruction.FieldInstruction)4 Instruction (org.freud.analysed.classbytecode.method.instruction.Instruction)4 IntOperandInstruction (org.freud.analysed.classbytecode.method.instruction.IntOperandInstruction)4 JumpInstruction (org.freud.analysed.classbytecode.method.instruction.JumpInstruction)4 MethodInvocationInstruction (org.freud.analysed.classbytecode.method.instruction.MethodInvocationInstruction)4 ReferenceOperandInstruction (org.freud.analysed.classbytecode.method.instruction.ReferenceOperandInstruction)4 VarInstruction (org.freud.analysed.classbytecode.method.instruction.VarInstruction)4 Opcode (org.freud.analysed.classbytecode.method.instruction.Opcode)2 Type (org.objectweb.asm.Type)1