Class Util

java.lang.Object
org.glassfish.pfl.tf.spi.Util

public class Util extends Object
Some useful utilities for generating code using ASM. Nothing in here should be specific to the classfile enhancer for tracing.
  • Field Details

    • debug

      private final boolean debug
    • verbose

      private final int verbose
  • Constructor Details

    • Util

      public Util(boolean debug, int verbose)
  • Method Details

    • getDebug

      public boolean getDebug()
    • info

      public void info(int level, String str)
    • msg

      public void msg(String str)
    • error

      public void error(String str)
    • initLocal

      public void initLocal(org.objectweb.asm.MethodVisitor mv, org.objectweb.asm.tree.LocalVariableNode var)
    • getFullMethodDescriptor

      public String getFullMethodDescriptor(String name, String desc)
    • getFullMethodDescriptor

      public String getFullMethodDescriptor(org.objectweb.asm.tree.MethodNode mn)
    • getFullMethodDescriptor

      public String getFullMethodDescriptor(org.objectweb.asm.tree.MethodInsnNode mn)
    • getFullMethodDescriptor

      public String getFullMethodDescriptor(Method method)
    • newWithSimpleConstructor

      public void newWithSimpleConstructor(org.objectweb.asm.MethodVisitor mv, Class<?> cls)
    • augmentInfoMethodDescriptor

      public String augmentInfoMethodDescriptor(String desc)
    • emitIntConstant

      public void emitIntConstant(org.objectweb.asm.MethodVisitor mv, int val)
    • wrapArg

      public int wrapArg(org.objectweb.asm.MethodVisitor mv, int argIndex, org.objectweb.asm.Type atype)
    • wrapArgs

      public void wrapArgs(org.objectweb.asm.MethodVisitor mv, int access, String desc)
    • storeFromXReturn

      public void storeFromXReturn(org.objectweb.asm.MethodVisitor mv, int returnOpcode, org.objectweb.asm.tree.LocalVariableNode holder)
    • loadFromXReturn

      public void loadFromXReturn(org.objectweb.asm.MethodVisitor mv, int returnOpcode, org.objectweb.asm.tree.LocalVariableNode holder)
    • verify

      private void verify(byte[] cls)
    • hasAccess

      public boolean hasAccess(int access, int flag)
    • opcodeToString

      public static String opcodeToString(int opcode)
    • transform

      public byte[] transform(boolean debug, byte[] cls, Function<org.objectweb.asm.ClassVisitor,org.objectweb.asm.ClassVisitor> factory)