Package org.glassfish.pfl.tf.spi
Class Util
java.lang.Object
org.glassfish.pfl.tf.spi.Util
Some useful utilities for generating code using ASM. Nothing in here
should be specific to the classfile enhancer for tracing.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
emitIntConstant
(org.objectweb.asm.MethodVisitor mv, int val) void
boolean
getDebug()
getFullMethodDescriptor
(Method method) getFullMethodDescriptor
(String name, String desc) getFullMethodDescriptor
(org.objectweb.asm.tree.MethodInsnNode mn) getFullMethodDescriptor
(org.objectweb.asm.tree.MethodNode mn) boolean
hasAccess
(int access, int flag) void
void
initLocal
(org.objectweb.asm.MethodVisitor mv, org.objectweb.asm.tree.LocalVariableNode var) void
loadFromXReturn
(org.objectweb.asm.MethodVisitor mv, int returnOpcode, org.objectweb.asm.tree.LocalVariableNode holder) void
void
newWithSimpleConstructor
(org.objectweb.asm.MethodVisitor mv, Class<?> cls) static String
opcodeToString
(int opcode) void
storeFromXReturn
(org.objectweb.asm.MethodVisitor mv, int returnOpcode, org.objectweb.asm.tree.LocalVariableNode holder) byte[]
transform
(boolean debug, byte[] cls, Function<org.objectweb.asm.ClassVisitor, org.objectweb.asm.ClassVisitor> factory) private void
verify
(byte[] cls) int
wrapArg
(org.objectweb.asm.MethodVisitor mv, int argIndex, org.objectweb.asm.Type atype) void
-
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
-
msg
-
error
-
initLocal
public void initLocal(org.objectweb.asm.MethodVisitor mv, org.objectweb.asm.tree.LocalVariableNode var) -
getFullMethodDescriptor
-
getFullMethodDescriptor
-
getFullMethodDescriptor
-
getFullMethodDescriptor
-
newWithSimpleConstructor
-
augmentInfoMethodDescriptor
-
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
-
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
-
transform
public byte[] transform(boolean debug, byte[] cls, Function<org.objectweb.asm.ClassVisitor, org.objectweb.asm.ClassVisitor> factory)
-