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

The following examples show how to use proguard.classfile.instruction.InstructionConstants#OP_DUP . 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: CodePreverifier.java    From java-n-IDE-for-Android with Apache License 2.0 4 votes vote down vote up
/**
 * Returns whether the given instruction opcode represents a dup or swap
 * instruction (dup, dup_x1, dup_x2, dup2, dup2_x1, dup2_x2, swap).
 */
private boolean isDupOrSwap(int opcode)
{
    return opcode >= InstructionConstants.OP_DUP &&
           opcode <= InstructionConstants.OP_SWAP;
}
 
Example 2
Source File: EvaluationShrinker.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)
{
    switch (simpleInstruction.opcode)
    {
        case InstructionConstants.OP_DUP:
            conditionallyMarkStackEntryProducers(offset, 0, 0);
            conditionallyMarkStackEntryProducers(offset, 1, 0);
            break;
        case InstructionConstants.OP_DUP_X1:
            conditionallyMarkStackEntryProducers(offset, 0, 0);
            conditionallyMarkStackEntryProducers(offset, 1, 1);
            conditionallyMarkStackEntryProducers(offset, 2, 0);
            break;
        case InstructionConstants.OP_DUP_X2:
            conditionallyMarkStackEntryProducers(offset, 0, 0);
            conditionallyMarkStackEntryProducers(offset, 1, 1);
            conditionallyMarkStackEntryProducers(offset, 2, 2);
            conditionallyMarkStackEntryProducers(offset, 3, 0);
            break;
        case InstructionConstants.OP_DUP2:
            conditionallyMarkStackEntryProducers(offset, 0, 0);
            conditionallyMarkStackEntryProducers(offset, 1, 1);
            conditionallyMarkStackEntryProducers(offset, 2, 0);
            conditionallyMarkStackEntryProducers(offset, 3, 1);
            break;
        case InstructionConstants.OP_DUP2_X1:
            conditionallyMarkStackEntryProducers(offset, 0, 0);
            conditionallyMarkStackEntryProducers(offset, 1, 1);
            conditionallyMarkStackEntryProducers(offset, 2, 2);
            conditionallyMarkStackEntryProducers(offset, 3, 0);
            conditionallyMarkStackEntryProducers(offset, 4, 1);
            break;
        case InstructionConstants.OP_DUP2_X2:
            conditionallyMarkStackEntryProducers(offset, 0, 0);
            conditionallyMarkStackEntryProducers(offset, 1, 1);
            conditionallyMarkStackEntryProducers(offset, 2, 2);
            conditionallyMarkStackEntryProducers(offset, 3, 3);
            conditionallyMarkStackEntryProducers(offset, 4, 0);
            conditionallyMarkStackEntryProducers(offset, 5, 1);
            break;
        case InstructionConstants.OP_SWAP:
            conditionallyMarkStackEntryProducers(offset, 0, 1);
            conditionallyMarkStackEntryProducers(offset, 1, 0);
            break;
        default:
            markStackProducers(clazz, offset, simpleInstruction);
            break;
    }
}
 
Example 3
Source File: EvaluationShrinker.java    From java-n-IDE-for-Android with Apache License 2.0 4 votes vote down vote up
/**
 * Returns whether the given instruction is a dup or swap instruction
 * (dup, dup_x1, dup_x2, dup2, dup2_x1, dup2_x2, swap).
 */
private boolean isDupOrSwap(Instruction instruction)
{
    return instruction.opcode >= InstructionConstants.OP_DUP &&
           instruction.opcode <= InstructionConstants.OP_SWAP;
}
 
Example 4
Source File: CodePreverifier.java    From proguard with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Returns whether the given instruction opcode represents a dup or swap
 * instruction (dup, dup_x1, dup_x2, dup2, dup2_x1, dup2_x2, swap).
 */
private boolean isDupOrSwap(int opcode)
{
    return opcode >= InstructionConstants.OP_DUP &&
           opcode <= InstructionConstants.OP_SWAP;
}
 
Example 5
Source File: CodePreverifier.java    From bazel with Apache License 2.0 4 votes vote down vote up
/**
 * Returns whether the given instruction opcode represents a dup or swap
 * instruction (dup, dup_x1, dup_x2, dup2, dup2_x1, dup2_x2, swap).
 */
private boolean isDupOrSwap(int opcode)
{
    return opcode >= InstructionConstants.OP_DUP &&
           opcode <= InstructionConstants.OP_SWAP;
}