Examples of Opcode


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

        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

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

    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

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

            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

Examples of org.java_websocket.framing.Framedata.Opcode

    try {
      frames = draft.translateFrame( socketBuffer );
      for( Framedata f : frames ) {
        if( DEBUG )
          System.out.println( "matched frame: " + f );
        Opcode curop = f.getOpcode();
        boolean fin = f.isFin();

        if( curop == Opcode.CLOSING ) {
          int code = CloseFrame.NOCODE;
          String reason = "";
View Full Code Here

Examples of org.java_websocket.framing.Framedata.Opcode

    if( rsv != 0 )
      throw new InvalidFrameException( "bad rsv " + rsv );
    byte b2 = buffer.get( /*1*/);
    boolean MASK = ( b2 & -128 ) != 0;
    int payloadlength = (byte) ( b2 & ~(byte) 128 );
    Opcode optcode = toOpcode( (byte) ( b1 & 15 ) );

    if( !FIN ) {
      if( optcode == Opcode.PING || optcode == Opcode.PONG || optcode == Opcode.CLOSING ) {
        throw new InvalidFrameException( "control frames may no be fragmented" );
      }
View Full Code Here

Examples of org.jf.dexlib2.Opcode

        List<Task> switchPayloadTasks = Lists.newArrayList();
        index = 0;
        for (final Instruction instruction: methodImplementation.getInstructions()) {
            final MethodLocation location = instructionList.get(index);
            final Opcode opcode = instruction.getOpcode();
            if (opcode == Opcode.PACKED_SWITCH_PAYLOAD || opcode == Opcode.SPARSE_SWITCH_PAYLOAD) {
                switchPayloadTasks.add(new Task() {
                    @Override public void perform() {
                        convertAndSetInstruction(location, codeAddressToIndex, instruction);
                    }
View Full Code Here

Examples of org.jf.dexlib2.Opcode

            opcode == Opcode.THROW_VERIFICATION_ERROR;
    }

    @Override
    public boolean writeTo(IndentingWriter writer) throws IOException {
        Opcode opcode = instruction.getOpcode();
        String verificationErrorName = null;
        String referenceString = null;

        boolean commentOutInstruction = false;

        if (instruction instanceof Instruction20bc) {
            int verificationError = ((Instruction20bc)instruction).getVerificationError();
            verificationErrorName = VerificationError.getVerificationErrorName(verificationError);
            if (verificationErrorName == null) {
                writer.write("#was invalid verification error type: ");
                writer.printSignedIntAsDec(verificationError);
                writer.write("\n");
                verificationErrorName = "generic-error";
            }
        }

        if (instruction instanceof ReferenceInstruction) {
            ReferenceInstruction referenceInstruction = (ReferenceInstruction)instruction;
            try {
                Reference reference = referenceInstruction.getReference();

                String classContext = null;
                if (methodDef.classDef.options.useImplicitReferences) {
                    classContext = methodDef.method.getDefiningClass();
                }

                referenceString = ReferenceUtil.getReferenceString(reference, classContext);
                assert referenceString != null;
            } catch (InvalidItemIndex ex) {
                writer.write("#");
                writer.write(ex.getMessage());
                writer.write("\n");
                commentOutInstruction = true;

                referenceString = String.format("%s@%d",
                    ReferenceType.toString(referenceInstruction.getReferenceType()),
                    ex.getInvalidIndex());
            } catch (ReferenceType.InvalidReferenceTypeException ex) {
                writer.write("#invalid reference type: ");
                writer.printSignedIntAsDec(ex.getReferenceType());
                commentOutInstruction = true;

                referenceString = "invalid_reference";
            }
        }

        if (instruction instanceof Instruction31t) {
            Opcode payloadOpcode;
            switch (instruction.getOpcode()) {
                case PACKED_SWITCH:
                    payloadOpcode = Opcode.PACKED_SWITCH_PAYLOAD;
                    break;
                case SPARSE_SWITCH:
View Full Code Here

Examples of org.jf.dexlib2.Opcode

    public LabelMethodItem getLabel() {
        return label;
    }

    private String getLabelPrefix() {
        Opcode opcode = instruction.getOpcode();
        switch (opcode.format) {
            case Format10t:
            case Format20t:
            case Format30t:
                return "goto_";
View Full Code Here

Examples of org.jf.dexlib2.Opcode

            instructionOffsetMap = new InstructionOffsetMap(instructions);

            for (int i=0; i<instructions.size(); i++) {
                Instruction instruction = instructions.get(i);

                Opcode opcode = instruction.getOpcode();
                if (opcode == Opcode.PACKED_SWITCH) {
                    boolean valid = true;
                    int codeOffset = instructionOffsetMap.getInstructionCodeOffset(i);
                    int targetOffset = codeOffset + ((OffsetInstruction)instruction).getCodeOffset();
                    try {
View Full Code Here

Examples of org.jf.dexlib2.Opcode

                    }
                });
            }

            if (!classDef.options.noAccessorComments && (instruction instanceof ReferenceInstruction)) {
                Opcode opcode = instruction.getOpcode();

                if (opcode.referenceType == ReferenceType.METHOD) {
                    MethodReference methodReference = null;
                    try {
                        methodReference = (MethodReference)((ReferenceInstruction)instruction).getReference();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.