Java Code Examples for proguard.classfile.instruction.InstructionConstants#OP_ATHROW

The following examples show how to use proguard.classfile.instruction.InstructionConstants#OP_ATHROW . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BranchTargetFinder.java    From java-n-IDE-for-Android with Apache License 2.0 6 votes vote down vote up
public void visitSimpleInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SimpleInstruction simpleInstruction)
{
    // Mark the instruction.
    instructionMarks[offset] |= INSTRUCTION;

    // Check if this is the first instruction of a subroutine.
    checkSubroutine(offset);

    byte opcode = simpleInstruction.opcode;
    if (opcode == InstructionConstants.OP_IRETURN ||
        opcode == InstructionConstants.OP_LRETURN ||
        opcode == InstructionConstants.OP_FRETURN ||
        opcode == InstructionConstants.OP_DRETURN ||
        opcode == InstructionConstants.OP_ARETURN ||
        opcode == InstructionConstants.OP_ATHROW)
    {
        // Mark the branch origin.
        markBranchOrigin(offset);

        // Mark the next instruction.
        markAfterBranchOrigin(offset + simpleInstruction.length(offset));
    }
}
 
Example 2
Source File: StackSizeComputer.java    From java-n-IDE-for-Android with Apache License 2.0 5 votes vote down vote up
public void visitSimpleInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SimpleInstruction simpleInstruction)
{
    byte opcode = simpleInstruction.opcode;

    // Some simple instructions exit from the current instruction block.
    exitInstructionBlock =
        opcode == InstructionConstants.OP_IRETURN ||
        opcode == InstructionConstants.OP_LRETURN ||
        opcode == InstructionConstants.OP_FRETURN ||
        opcode == InstructionConstants.OP_DRETURN ||
        opcode == InstructionConstants.OP_ARETURN ||
        opcode == InstructionConstants.OP_RETURN  ||
        opcode == InstructionConstants.OP_ATHROW;
}
 
Example 3
Source File: SideEffectInstructionChecker.java    From java-n-IDE-for-Android with Apache License 2.0 5 votes vote down vote up
public void visitSimpleInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SimpleInstruction simpleInstruction)
{
    byte opcode = simpleInstruction.opcode;

    // Check for instructions that might cause side effects.
    if (opcode == InstructionConstants.OP_IASTORE      ||
        opcode == InstructionConstants.OP_LASTORE      ||
        opcode == InstructionConstants.OP_FASTORE      ||
        opcode == InstructionConstants.OP_DASTORE      ||
        opcode == InstructionConstants.OP_AASTORE      ||
        opcode == InstructionConstants.OP_BASTORE      ||
        opcode == InstructionConstants.OP_CASTORE      ||
        opcode == InstructionConstants.OP_SASTORE      ||
        opcode == InstructionConstants.OP_ATHROW       ||
        opcode == InstructionConstants.OP_MONITORENTER ||
        opcode == InstructionConstants.OP_MONITOREXIT  ||
        (includeReturnInstructions &&
         (opcode == InstructionConstants.OP_IRETURN ||
          opcode == InstructionConstants.OP_LRETURN ||
          opcode == InstructionConstants.OP_FRETURN ||
          opcode == InstructionConstants.OP_DRETURN ||
          opcode == InstructionConstants.OP_ARETURN ||
          opcode == InstructionConstants.OP_RETURN)))
    {
        // These instructions always cause a side effect.
        hasSideEffects = true;
    }

}
 
Example 4
Source File: ReachableCodeMarker.java    From java-n-IDE-for-Android with Apache License 2.0 5 votes vote down vote up
public void visitSimpleInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SimpleInstruction simpleInstruction)
{
    byte opcode = simpleInstruction.opcode;
    if (opcode == InstructionConstants.OP_IRETURN ||
        opcode == InstructionConstants.OP_LRETURN ||
        opcode == InstructionConstants.OP_FRETURN ||
        opcode == InstructionConstants.OP_DRETURN ||
        opcode == InstructionConstants.OP_ARETURN ||
        opcode == InstructionConstants.OP_RETURN  ||
        opcode == InstructionConstants.OP_ATHROW)
    {
        next = false;
    }
}
 
Example 5
Source File: ExceptionInstructionChecker.java    From java-n-IDE-for-Android with Apache License 2.0 4 votes vote down vote up
public void visitSimpleInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SimpleInstruction simpleInstruction)
{
    byte opcode = simpleInstruction.opcode;

    // Check for instructions that may throw exceptions.
    // Note that monitorexit can not sensibly throw exceptions, except the
    // broken and deprecated asynchronous ThreadDeath. Removing the
    // artificial infinite looping exception blocks that recent compilers
    // add does not strictly follow the JVM specs, but it does have the
    // additional benefit of avoiding a bug in the JVM in JDK 1.1.
    switch (opcode)
    {
        case InstructionConstants.OP_IDIV:
        case InstructionConstants.OP_LDIV:
        case InstructionConstants.OP_IREM:
        case InstructionConstants.OP_LREM:
        case InstructionConstants.OP_IALOAD:
        case InstructionConstants.OP_LALOAD:
        case InstructionConstants.OP_FALOAD:
        case InstructionConstants.OP_DALOAD:
        case InstructionConstants.OP_AALOAD:
        case InstructionConstants.OP_BALOAD:
        case InstructionConstants.OP_CALOAD:
        case InstructionConstants.OP_SALOAD:
        case InstructionConstants.OP_IASTORE:
        case InstructionConstants.OP_LASTORE:
        case InstructionConstants.OP_FASTORE:
        case InstructionConstants.OP_DASTORE:
        case InstructionConstants.OP_AASTORE:
        case InstructionConstants.OP_BASTORE:
        case InstructionConstants.OP_CASTORE:
        case InstructionConstants.OP_SASTORE:
        case InstructionConstants.OP_NEWARRAY:
        case InstructionConstants.OP_ARRAYLENGTH:
        case InstructionConstants.OP_ATHROW:
        case InstructionConstants.OP_MONITORENTER:
            // These instructions may throw exceptions.
            mayThrowExceptions = true;
    }

}