示例#1
0
 @Override
 public void visitTableSwitchInsn(final int min, final int max,
         final Label dflt, final Label... labels) {
     checkStartCode();
     checkEndCode();
     if (max < min) {
         throw new IllegalArgumentException("Max = " + max
                 + " must be greater than or equal to min = " + min);
     }
     checkLabel(dflt, false, "default label");
     checkNonDebugLabel(dflt);
     if (labels == null || labels.length != max - min + 1) {
         throw new IllegalArgumentException(
                 "There must be max - min + 1 labels");
     }
     for (int i = 0; i < labels.length; ++i) {
         checkLabel(labels[i], false, "label at index " + i);
         checkNonDebugLabel(labels[i]);
     }
     super.visitTableSwitchInsn(min, max, dflt, labels);
     for (Label label : labels) {
         usedLabels.add(label);
     }
     ++insnCount;
 }
示例#2
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;
 }
示例#3
0
 @Override
 public void visitLookupSwitchInsn(final Label dflt, final int[] keys,
         final Label[] labels) {
     checkEndCode();
     checkStartCode();
     checkLabel(dflt, false, "default label");
     checkNonDebugLabel(dflt);
     if (keys == null || labels == null || keys.length != labels.length) {
         throw new IllegalArgumentException(
                 "There must be the same number of keys and labels");
     }
     for (int i = 0; i < labels.length; ++i) {
         checkLabel(labels[i], false, "label at index " + i);
         checkNonDebugLabel(labels[i]);
     }
     super.visitLookupSwitchInsn(dflt, keys, labels);
     usedLabels.add(dflt);
     for (Label label : labels) {
         usedLabels.add(label);
     }
     ++insnCount;
 }
示例#4
0
 @Override
 public void visitTryCatchBlock(final Label start, final Label end,
         final Label handler, final String type) {
     checkStartCode();
     checkEndCode();
     checkLabel(start, false, "start label");
     checkLabel(end, false, "end label");
     checkLabel(handler, false, "handler label");
     checkNonDebugLabel(start);
     checkNonDebugLabel(end);
     checkNonDebugLabel(handler);
     if (labels.get(start) != null || labels.get(end) != null
             || labels.get(handler) != null) {
         throw new IllegalStateException(
                 "Try catch blocks must be visited before their labels");
     }
     if (type != null) {
         checkInternalName(type, "type");
     }
     super.visitTryCatchBlock(start, end, handler, type);
     handlers.add(start);
     handlers.add(end);
 }