/** * Visits the default value of this annotation interface method. * * @return a visitor to the visit the actual default value of this * annotation interface method, or <tt>null</tt> if this visitor is * not interested in visiting this default value. The 'name' * parameters passed to the methods of this annotation visitor are * ignored. Moreover, exacly one visit method must be called on this * annotation visitor, followed by visitEnd. */ public AnnotationVisitor visitAnnotationDefault() { if (mv != null) { return mv.visitAnnotationDefault(); } return null; }
/** * Starts the visit of the method's code, if any (i.e. non abstract method). */ public void visitCode() { if (mv != null) { mv.visitCode(); } }
public void aconst(final Object cst) { if (cst == null) { mv.visitInsn(Opcodes.ACONST_NULL); } else { mv.visitLdcInsn(cst); } }
public void iconst(final int cst) { if (cst >= -1 && cst <= 5) { mv.visitInsn(Opcodes.ICONST_0 + cst); } else if (cst >= Byte.MIN_VALUE && cst <= Byte.MAX_VALUE) { mv.visitIntInsn(Opcodes.BIPUSH, cst); } else if (cst >= Short.MIN_VALUE && cst <= Short.MAX_VALUE) { mv.visitIntInsn(Opcodes.SIPUSH, cst); } else { mv.visitLdcInsn(new Integer(cst)); } }
Label handler = readLabel(readUnsignedShort(u + 6), labels); String type = readUTF8(items[readUnsignedShort(u + 8)], c); mv.visitTryCatchBlock(start, end, handler, type); u += 8; mv.visitLabel(l); if ((context.flags & SKIP_DEBUG) == 0 && l.line > 0) { mv.visitLineNumber(l.line, l); mv.visitFrame(Opcodes.F_NEW, frame.localCount, frame.local, frame.stackCount, frame.stack); } else { mv.visitFrame(frame.mode, frame.localDiff, frame.local, frame.stackCount, frame.stack); switch (ClassWriter.TYPE[opcode]) { case ClassWriter.NOARG_INSN: mv.visitInsn(opcode); u += 1; break; if (opcode > Opcodes.ISTORE) { opcode -= 59; // ISTORE_0 mv.visitVarInsn(Opcodes.ISTORE + (opcode >> 2), opcode & 0x3); } else { opcode -= 26; // ILOAD_0 mv.visitVarInsn(Opcodes.ILOAD + (opcode >> 2), opcode & 0x3);
AnnotationVisitor dv = mv.visitAnnotationDefault(); readAnnotationValue(dann, c, null, dv); if(dv != null) mv.visitCode(); mv.visitTryCatchBlock(start, end, handler, null); mv.visitTryCatchBlock(start, end, handler, mv.visitLabel(l); if(!skipDebug && l.line > 0) mv.visitInsn(opcode); v += 1; break; mv.visitTableSwitchInsn(min, max, labels[label], mv.visitLookupSwitchInsn(labels[label], keys, values); mv.visitFieldInsn(opcode, iowner, iname, idesc);
mv.visitCode(); mv.visitVarInsn(ALOAD, 0); mv.visitLdcInsn(bName); mv.visitMethodInsn(INVOKESTATIC, "clojure/lang/Keyword", "intern", "(Ljava/lang/String;)Lclojure/lang/Keyword;"); mv.visitInsn(ACONST_NULL); mv.visitMethodInsn(INVOKEINTERFACE, "clojure/lang/IPersistentMap", "valAt", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); if(k.isPrimitive()) mv.visitTypeInsn(CHECKCAST, Type.getType(boxClass(k)).getInternalName()); mv.visitVarInsn(ASTORE, i); mv.visitVarInsn(ALOAD, 0); mv.visitLdcInsn(bName); mv.visitMethodInsn(INVOKESTATIC, "clojure/lang/Keyword", "intern", "(Ljava/lang/String;)Lclojure/lang/Keyword;"); mv.visitMethodInsn(INVOKEINTERFACE, "clojure/lang/IPersistentMap", "without", "(Ljava/lang/Object;)Lclojure/lang/IPersistentMap;"); mv.visitVarInsn(ASTORE, 0); mv.visitTypeInsn(Opcodes.NEW, className); mv.visitInsn(DUP); mv.visitVarInsn(ALOAD, i); Class k = tagClass(tagOf(hintedFields.nth(i-1))); if(k.isPrimitive()) mv.visitMethodInsn(INVOKEVIRTUAL, b, n+"Value", "()"+p); mv.visitInsn(ACONST_NULL); mv.visitVarInsn(ALOAD, 0);
AnnotationVisitor dv = mv.visitAnnotationDefault(); readAnnotationValue(dann, c, null, dv); if (dv != null) { for (int i = readUnsignedShort(anns), v = anns + 2; i > 0; --i) { v = readAnnotationValues(v + 2, c, true, mv.visitAnnotation(readUTF8(v, c), true)); for (int i = readUnsignedShort(ianns), v = ianns + 2; i > 0; --i) { v = readAnnotationValues(v + 2, c, true, mv.visitAnnotation(readUTF8(v, c), false)); Attribute attr = attributes.next; attributes.next = null; mv.visitAttribute(attributes); attributes = attr; context.name = name; context.desc = desc; mv.visitCode(); readCode(mv, context, code); mv.visitEnd();
@Override public void visitJumpInsn(final int opcode, final Label label) { minSize += 3; if (opcode == GOTO || opcode == JSR) { maxSize += 5; } else { maxSize += 8; } if (mv != null) { mv.visitJumpInsn(opcode, label); } }
/** * Generates a POP instruction. */ public void pop() { mv.visitInsn(Opcodes.POP); }
mv.visitInsn(Opcodes.ACONST_NULL); } else { switch (value.getSort()) { case Type.BOOLEAN: mv.visitFieldInsn(Opcodes.GETSTATIC, "java/lang/Boolean", "TYPE", CLDESC); break; case Type.CHAR: mv.visitFieldInsn(Opcodes.GETSTATIC, "java/lang/Character", "TYPE", CLDESC); break; case Type.BYTE: mv.visitFieldInsn(Opcodes.GETSTATIC, "java/lang/Byte", "TYPE", CLDESC); break; case Type.SHORT: mv.visitFieldInsn(Opcodes.GETSTATIC, "java/lang/Short", "TYPE", CLDESC); break; case Type.INT: mv.visitFieldInsn(Opcodes.GETSTATIC, "java/lang/Integer", "TYPE", CLDESC); break; case Type.FLOAT: mv.visitFieldInsn(Opcodes.GETSTATIC, "java/lang/Float", "TYPE", CLDESC); break; case Type.LONG: mv.visitFieldInsn(Opcodes.GETSTATIC, "java/lang/Long", "TYPE",
@Override public void visitFieldInsn(final int opcode, final String owner, final String name, final String desc) { minSize += 3; maxSize += 3; if (mv != null) { mv.visitFieldInsn(opcode, owner, name, desc); } }
/** * Visits an IINC instruction. * * @param var * index of the local variable to be incremented. * @param increment * amount to increment the local variable by. */ public void visitIincInsn(int var, int increment) { if (mv != null) { mv.visitIincInsn(var, increment); } }
/** * Marks the current code position with the given label. * * @param label * a label. */ public void mark(final Label label) { mv.visitLabel(label); }
@Override public void visitTypeInsn(final int opcode, final String type) { if (opcode == Opcodes.NEW) { if (labels == null) { Label l = new Label(); labels = new ArrayList<Label>(3); labels.add(l); if (mv != null) { mv.visitLabel(l); } } for (int i = 0; i < labels.size(); ++i) { uninitializedTypes.put(labels.get(i), type); } } if (mv != null) { mv.visitTypeInsn(opcode, type); } execute(opcode, 0, type); }
break; default: mv.visitTypeInsn(Opcodes.ANEWARRAY, type.getInternalName()); return; mv.visitIntInsn(Opcodes.NEWARRAY, typ);
@Override public void visitIntInsn(final int opcode, final int operand) { if (opcode == SIPUSH) { minSize += 3; maxSize += 3; } else { minSize += 2; maxSize += 2; } if (mv != null) { mv.visitIntInsn(opcode, operand); } }
Object[] stack) { if (mv != null) { mv.visitFrame(type, nLocal, local, nStack, stack);