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

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


        final Instruction[] found = new Instruction[1];
        analysed.findInstruction(new AbstractInstructionVisitor() {
            @Override
            public void noArgInstruction(final Instruction instruction) {
                for (int i = 0; i < opcodes.length; i++) {
                    Opcode opcode = opcodes[i];
                    if (instruction.getOpcode() == opcode) {
                        found[0] = instruction;
                        break;
                    }
                }
View Full Code Here


        final Instruction instruction = new Instruction(instructionList.size(), OPCODES_ARRAY[opcode], currentLineNumber);
        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 {
View Full Code Here

        final Instruction instruction = new VarInstruction(instructionList.size(), OPCODES_ARRAY[opcodeUsed], currentLineNumber, var);
        updateCurrentState(instruction);
    }

    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

    private void updateCurrentState(final Instruction instruction) {
        instructionList.add(instruction);

//        System.out.println(name + " " + instruction + " "  + labelByAsmLabelMap);

        final Opcode opcode = instruction.getOpcode();
        ensureCurrentLocalsSize(instruction.getVarIndex());
        currentLocals = opcode.updateLocals(currentLocals, instruction);
        currentOperandStack = opcode.updateOperandStack(this, instruction, currentOperandStack);
        instruction.setOperandStack(currentOperandStack);
    }
View Full Code Here

            protected boolean matchesSafely(final ClassByteCodeMethod item) {
                item.findInstruction(new AbstractInstructionVisitor() {
                    @Override
                    public void noArgInstruction(final Instruction instruction) {
                        for (int i = 0; i < opcodes.length; i++) {
                            Opcode opcode = opcodes[i];
                            if (instruction.getOpcode() == opcode) {
                                found = instruction;
                                break;
                            }
                        }
                    }
                });
                return found != null;
            }

            @Override
            public void describeTo(final Description description) {
                description.appendText("containsInstructions(");
                for (int i = 0; i < opcodes.length; i++) {
                    Opcode opcode = opcodes[i];
                    description.appendText(opcode.name());
                    description.appendText(", ");

                }
                description.appendText(") found");
            }
View Full Code Here

TOP

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

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.