Java Code Examples for org.apache.bcel.Const#NOP

The following examples show how to use org.apache.bcel.Const#NOP . 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: DismantleBytecode.java    From spotbugs with GNU Lesser General Public License v2.1 5 votes vote down vote up
/**
 * return previous opcode;
 *
 * @param offset
 *            0 for current opcode, 1 for one before that, etc.
 */
public int getPrevOpcode(int offset) {
    if (offset < 0) {
        throw new IllegalArgumentException("offset (" + offset + ") must be nonnegative");
    }
    if (offset >= prevOpcode.length || offset > sizePrevOpcodeBuffer) {
        return Const.NOP;
    }
    int pos = currentPosInPrevOpcodeBuffer - offset;
    if (pos < 0) {
        pos += prevOpcode.length;
    }
    return prevOpcode[pos];
}
 
Example 2
Source File: FindPuzzlers.java    From spotbugs with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
public void visit(Code obj) {
    prevOpcodeIncrementedRegister = -1;
    best_priority_for_ICAST_INTEGER_MULTIPLY_CAST_TO_LONG = LOW_PRIORITY + 1;
    prevOpCode = Const.NOP;
    previousMethodInvocation = null;
    badlyComputingOddState = 0;
    resetIMulCastLong();
    imul_distance = 10000;
    ternaryConversionState = 0;
    becameTop = -1;
    super.visit(obj);
    bugAccumulator.reportAccumulatedBugs();
    pendingUnreachableBranch = null;
}
 
Example 3
Source File: FindNonShortCircuit.java    From spotbugs with GNU Lesser General Public License v2.1 4 votes vote down vote up
@Override
public void visit(Method obj) {
    clearAll();
    prevOpcode = Const.NOP;
}