public void visitConstantInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, ConstantInstruction constantInstruction)
{
switch (constantInstruction.opcode)
{
case InstructionConstants.OP_GETSTATIC:
case InstructionConstants.OP_GETFIELD:
replaceAnyPushInstruction(clazz, offset, constantInstruction);
break;
case InstructionConstants.OP_INVOKEVIRTUAL:
case InstructionConstants.OP_INVOKESPECIAL:
case InstructionConstants.OP_INVOKESTATIC:
case InstructionConstants.OP_INVOKEINTERFACE:
if (constantInstruction.stackPushCount(clazz) > 0 &&
!sideEffectInstructionChecker.hasSideEffects(clazz,
method,
codeAttribute,
offset,
constantInstruction))
{
replaceAnyPushInstruction(clazz, offset, constantInstruction);
}
break;
case InstructionConstants.OP_CHECKCAST:
replaceReferencePushInstruction(clazz, offset, constantInstruction);
break;
}
}