示例#1
0
 @Override
 public void visitInsn(final int opcode) {
     checkStartCode();
     checkEndCode();
     checkOpcode(opcode, 0);
     super.visitInsn(opcode);
     ++insnCount;
 }
示例#2
0
 @Override
 public void visitVarInsn(final int opcode, final int var) {
     checkStartCode();
     checkEndCode();
     checkOpcode(opcode, 2);
     checkUnsignedShort(var, "Invalid variable index");
     super.visitVarInsn(opcode, var);
     ++insnCount;
 }
示例#3
0
 @Override
 public void visitJumpInsn(final int opcode, final Label label) {
     checkStartCode();
     checkEndCode();
     checkOpcode(opcode, 6);
     checkLabel(label, false, "label");
     checkNonDebugLabel(label);
     super.visitJumpInsn(opcode, label);
     usedLabels.add(label);
     ++insnCount;
 }
示例#4
0
 @Override
 public void visitFieldInsn(final int opcode, final String owner,
         final String name, final String desc) {
     checkStartCode();
     checkEndCode();
     checkOpcode(opcode, 4);
     checkInternalName(owner, "owner");
     checkUnqualifiedName(version, name, "name");
     checkDesc(desc, false);
     super.visitFieldInsn(opcode, owner, name, desc);
     ++insnCount;
 }
示例#5
0
 @Override
 public void visitTypeInsn(final int opcode, final String type) {
     checkStartCode();
     checkEndCode();
     checkOpcode(opcode, 3);
     checkInternalName(type, "type");
     if (opcode == Opcodes.NEW && type.charAt(0) == '[') {
         throw new IllegalArgumentException(
                 "NEW cannot be used to create arrays: " + type);
     }
     super.visitTypeInsn(opcode, type);
     ++insnCount;
 }
示例#6
0
 @Override
 public void visitMethodInsn(final int opcode, final String owner,
         final String name, final String desc) {
     checkStartCode();
     checkEndCode();
     checkOpcode(opcode, 5);
     if (opcode != Opcodes.INVOKESPECIAL || !"<init>".equals(name)) {
         checkMethodIdentifier(version, name, "name");
     }
     checkInternalName(owner, "owner");
     checkMethodDesc(desc);
     super.visitMethodInsn(opcode, owner, name, desc);
     ++insnCount;
 }
示例#7
0
 @Override
 public void visitIntInsn(final int opcode, final int operand) {
     checkStartCode();
     checkEndCode();
     checkOpcode(opcode, 1);
     switch (opcode) {
     case Opcodes.BIPUSH:
         checkSignedByte(operand, "Invalid operand");
         break;
     case Opcodes.SIPUSH:
         checkSignedShort(operand, "Invalid operand");
         break;
     // case Constants.NEWARRAY:
     default:
         if (operand < Opcodes.T_BOOLEAN || operand > Opcodes.T_LONG) {
             throw new IllegalArgumentException(
                     "Invalid operand (must be an array type code T_...): "
                             + operand);
         }
     }
     super.visitIntInsn(opcode, operand);
     ++insnCount;
 }