Example #1
0
 // 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;
 }
Example #2
0
 public Assembler putStatic(String owner, String name, String desc) {
   mv.visitFieldInsn(PUTSTATIC, owner, name, desc);
   return this;
 }
Example #3
0
 public Assembler loadStaticField(Type owner, String name, Type t) {
   mv.visitFieldInsn(Opcodes.GETSTATIC, owner.getInternalName(), name, t.getDescriptor());
   return this;
 }
Example #4
0
 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;
 }
Example #5
0
 public Assembler storeField(Type owner, String name, Type t) {
   mv.visitFieldInsn(Opcodes.PUTFIELD, owner.getInternalName(), name, t.getDescriptor());
   return this;
 }