Class BytecodeTasks


  • final class BytecodeTasks
    extends java.lang.Object
    Utility methods to generate common bytecode tasks.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private BytecodeTasks()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void box​(org.objectweb.asm.MethodVisitor mv, org.objectweb.asm.Type primitiveType)
      Boxes a primitive value on the Java stack.
      static int loadArgument​(org.objectweb.asm.MethodVisitor mv, java.lang.Class<?> parameterType, int slot)
      Loads a local argument onto the Java stack and returns the size of the argument.
      static void packArguments​(org.objectweb.asm.MethodVisitor mv, java.lang.Class<?>[] parameterTypes)
      Packs local arguments into an argument array on the Java stack.
      static void pushInteger​(org.objectweb.asm.MethodVisitor mv, int value)
      Pushes an integer onto the stack, choosing the most efficient opcode.
      static void unbox​(org.objectweb.asm.MethodVisitor mv, org.objectweb.asm.Type primitiveType)
      Unboxes a boxed value on the Java stack.
      static void unpackArguments​(org.objectweb.asm.MethodVisitor mv, java.lang.Class<?>[] parameterTypes)
      Unpacks an array of arguments and pushes them onto the Java stack.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BytecodeTasks

        private BytecodeTasks()
    • Method Detail

      • pushInteger

        public static void pushInteger​(org.objectweb.asm.MethodVisitor mv,
                                       int value)
        Pushes an integer onto the stack, choosing the most efficient opcode.
      • packArguments

        public static void packArguments​(org.objectweb.asm.MethodVisitor mv,
                                         java.lang.Class<?>[] parameterTypes)
        Packs local arguments into an argument array on the Java stack.
      • unpackArguments

        public static void unpackArguments​(org.objectweb.asm.MethodVisitor mv,
                                           java.lang.Class<?>[] parameterTypes)
        Unpacks an array of arguments and pushes them onto the Java stack.
      • loadArgument

        public static int loadArgument​(org.objectweb.asm.MethodVisitor mv,
                                       java.lang.Class<?> parameterType,
                                       int slot)
        Loads a local argument onto the Java stack and returns the size of the argument.
      • box

        public static void box​(org.objectweb.asm.MethodVisitor mv,
                               org.objectweb.asm.Type primitiveType)
        Boxes a primitive value on the Java stack.
      • unbox

        public static void unbox​(org.objectweb.asm.MethodVisitor mv,
                                 org.objectweb.asm.Type primitiveType)
        Unboxes a boxed value on the Java stack.