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

The following examples show how to use proguard.classfile.instruction.InstructionConstants#OP_LDC . 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: DotClassClassVisitor.java    From java-n-IDE-for-Android with Apache License 2.0 5 votes vote down vote up
public void visitConstantInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, ConstantInstruction constantInstruction)
{
    byte opcode = constantInstruction.opcode;

    // Could this instruction be a .class construct?
    if (opcode == InstructionConstants.OP_LDC ||
        opcode == InstructionConstants.OP_LDC_W)
    {
        clazz.constantPoolEntryAccept(constantInstruction.constantIndex,
                                      this);
    }
}
 
Example 2
Source File: DotClassMarker.java    From java-n-IDE-for-Android with Apache License 2.0 5 votes vote down vote up
public void visitConstantInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, ConstantInstruction constantInstruction)
{
    if (constantInstruction.opcode == InstructionConstants.OP_LDC ||
        constantInstruction.opcode == InstructionConstants.OP_LDC_W)
    {
        clazz.constantPoolEntryAccept(constantInstruction.constantIndex, this);
    }
}
 
Example 3
Source File: ReadWriteFieldMarker.java    From java-n-IDE-for-Android with Apache License 2.0 5 votes vote down vote up
public void visitConstantInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, ConstantInstruction constantInstruction)
{
    byte opcode = constantInstruction.opcode;

    // Check for instructions that involve fields.
    switch (opcode)
    {
        case InstructionConstants.OP_LDC:
        case InstructionConstants.OP_LDC_W:
            // Mark the field, if any, as being read from and written to.
            reading = true;
            writing = true;
            clazz.constantPoolEntryAccept(constantInstruction.constantIndex, this);
            break;

        case InstructionConstants.OP_GETSTATIC:
        case InstructionConstants.OP_GETFIELD:
            // Mark the field as being read from.
            reading = true;
            writing = false;
            clazz.constantPoolEntryAccept(constantInstruction.constantIndex, this);
            break;

        case InstructionConstants.OP_PUTSTATIC:
        case InstructionConstants.OP_PUTFIELD:
            // Mark the field as being written to.
            reading = false;
            writing = true;
            clazz.constantPoolEntryAccept(constantInstruction.constantIndex, this);
            break;
    }
}