// print the object on the top of the stack public Assembler printObject() { mv.visitFieldInsn(GETSTATIC, "java/lang/System", "out", "Ljava/io/PrintStream;"); mv.visitInsn(SWAP); mv.visitMethodInsn( INVOKEVIRTUAL, "java/io/PrintStream", "println", "(Ljava/lang/Object;)V", false); return this; }
public Assembler putStatic(String owner, String name, String desc) { mv.visitFieldInsn(PUTSTATIC, owner, name, desc); return this; }
public Assembler loadStaticField(Type owner, String name, Type t) { mv.visitFieldInsn(Opcodes.GETSTATIC, owner.getInternalName(), name, t.getDescriptor()); return this; }
public Assembler println(String msg) { mv.visitFieldInsn(GETSTATIC, "java/lang/System", "out", "Ljava/io/PrintStream;"); mv.visitLdcInsn(msg); invokeVirtual("java/io/PrintStream", "println", "(Ljava/lang/String;)V"); return this; }
public Assembler storeField(Type owner, String name, Type t) { mv.visitFieldInsn(Opcodes.PUTFIELD, owner.getInternalName(), name, t.getDescriptor()); return this; }