Package org.rsbot.loader.asm

Examples of org.rsbot.loader.asm.MethodVisitor.visitEnd()


    for (final Method m : methods) {
      final MethodVisitor mv = cv.visitMethod(m.access, m.name, m.desc, null, null);
      mv.visitCode();
      new CodeReader(m.code).accept(mv);
      mv.visitMaxs(m.max_stack, m.max_locals);
      mv.visitEnd();
    }
    cv.visitEnd();
  }
}
View Full Code Here


    mv.visitVarInsn(ALOAD, 0);
    mv.visitFieldInsn(GETFIELD, owner, name, desc);
    final int op = getReturnOpcode(desc);
    mv.visitInsn(op);
    mv.visitMaxs(op == LRETURN || op == DRETURN ? 2 : 1, (getter_access & ACC_STATIC) == 0 ? 1 : 0);
    mv.visitEnd();
  }

  private void visitGetter(
      final int getter_access,
      final String getter_name,
View Full Code Here

    mv.visitCode();
    mv.visitFieldInsn(GETSTATIC, owner, name, desc);
    final int op = getReturnOpcode(desc);
    mv.visitInsn(op);
    mv.visitMaxs(op == LRETURN || op == DRETURN ? 2 : 1, (getter_access & ACC_STATIC) == 0 ? 1 : 0);
    mv.visitEnd();
  }

  private int getReturnOpcode(String desc) {
    desc = desc.substring(desc.indexOf(")") + 1);
    if (desc.length() > 1) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.