Package org.freud.analysed.classbytecode.method.instruction

Examples of org.freud.analysed.classbytecode.method.instruction.Instruction


        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)) {
                    Instruction prevInstruction = analysed.getInstruction(instruction.getInstructionIndex() - 1);
                    OperandStack operandStack = prevInstruction.getOperandStack();
                    found[0] = true;
                    for (int i = expectedParamTypes.length - 1; i >= 0; i--) {
                        final String expectedType = typeEncoding(expectedParamTypes[i]);
                        if (!expectedType.equals(operandStack.getOperandType())) {
                            found[0] = false;
View Full Code Here


    public void visitCode() {
        // no op
    }

    public void visitInsn(final int opcode) {
        final Instruction instruction = new Instruction(instructionList.size(), OPCODES_ARRAY[opcode], currentLineNumber);
        updateCurrentState(instruction);
    }
View Full Code Here

        updateCurrentState(instruction);
    }

    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);
View Full Code Here

        }
        updateCurrentState(instruction);
    }

    public void visitVarInsn(final int opcodeUsed, final int var) {
        final Instruction instruction = new VarInstruction(instructionList.size(), OPCODES_ARRAY[opcodeUsed], currentLineNumber, var);
        updateCurrentState(instruction);
    }
View Full Code Here

    }

    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);
    }
View Full Code Here

    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);
    }
View Full Code Here

            final String argsAsString = matcher.group(1);
            final ArrayList<String> argsContainer = new ArrayList<String>();
            String returnType = matcher.group(2);
            parseArgs(argsAsString, argsContainer);
            String[] args = argsContainer.toArray(new String[argsContainer.size()]);
            final Instruction instruction = new MethodInvocationInstruction(instructionList.size(), OPCODES_ARRAY[opcode], currentLineNumber,
                                                                            "L" + owner + ";", name, args, returnType);
            updateCurrentState(instruction);
        }
    }
View Full Code Here

        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);
    }
View Full Code Here

            currentOperandStack = new StaticOperandStack(handledType, currentOperandStack, null);
        }
    }

    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);
View Full Code Here

        }
        updateCurrentState(instruction);
    }

    public void visitIincInsn(final int var, final int increment) {
        final Instruction instruction = new IntOperandInstruction(instructionList.size(), Opcode.IINC, currentLineNumber, increment);
        updateCurrentState(instruction);
    }
View Full Code Here

TOP

Related Classes of org.freud.analysed.classbytecode.method.instruction.Instruction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.