Search in sources :

Example 1 with JSRInlinerAdapter

use of org.apache.tapestry5.internal.plastic.asm.commons.JSRInlinerAdapter in project tapestry-5 by apache.

the class PlasticInternalUtils method convertBytecodeToClassNode.

public static ClassNode convertBytecodeToClassNode(byte[] bytecode) {
    ClassReader cr = new ClassReader(bytecode);
    ClassNode result = new ClassNode();
    ClassVisitor adapter = new ClassVisitor(Opcodes.ASM9, result) {

        @Override
        public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
            MethodVisitor delegate = super.visitMethod(access, name, desc, signature, exceptions);
            return new JSRInlinerAdapter(delegate, access, name, desc, signature, exceptions);
        }
    };
    cr.accept(adapter, 0);
    return result;
}
Also used : ClassNode(org.apache.tapestry5.internal.plastic.asm.tree.ClassNode) TraceClassVisitor(org.apache.tapestry5.internal.plastic.asm.util.TraceClassVisitor) JSRInlinerAdapter(org.apache.tapestry5.internal.plastic.asm.commons.JSRInlinerAdapter)

Aggregations

JSRInlinerAdapter (org.apache.tapestry5.internal.plastic.asm.commons.JSRInlinerAdapter)1 ClassNode (org.apache.tapestry5.internal.plastic.asm.tree.ClassNode)1 TraceClassVisitor (org.apache.tapestry5.internal.plastic.asm.util.TraceClassVisitor)1