Package org.objectweb.asm

Examples of org.objectweb.asm.ClassWriter.visitMethod()


    writer.visitField(Opcodes.ACC_PRIVATE | Opcodes.ACC_FINAL, "data",
        "[Z", null, null);

    // Constructor
    GeneratorAdapter gen = new GeneratorAdapter(writer.visitMethod(
        Opcodes.ACC_PUBLIC, "<init>", "()V", null, new String[0]),
        Opcodes.ACC_PUBLIC, "<init>", "()V");
    gen.visitCode();
    gen.loadThis();
    gen.invokeConstructor(Type.getType(Object.class), new Method("<init>",
View Full Code Here


    gen.returnValue();
    gen.visitMaxs(size + 1, 0);
    gen.visitEnd();

    // get()
    gen = new GeneratorAdapter(writer.visitMethod(Opcodes.ACC_PUBLIC,
        "get", "()[Z", null, new String[0]), Opcodes.ACC_PUBLIC, "get",
        "()[Z");
    gen.visitCode();
    gen.loadThis();
    gen.getField(classType, "data", Type.getObjectType("[Z"));
View Full Code Here

    gen.returnValue();
    gen.visitMaxs(1, 0);
    gen.visitEnd();

    // a()
    gen = new GeneratorAdapter(writer.visitMethod(Opcodes.ACC_PUBLIC, "a",
        "()V", null, new String[0]), Opcodes.ACC_PUBLIC, "a", "()V");
    gen.visitCode();
    gen.loadThis();
    gen.getField(classType, "data", Type.getObjectType("[Z"));
    gen.push(0);
View Full Code Here

    gen.returnValue();
    gen.visitMaxs(3, 0);
    gen.visitEnd();

    // b()
    gen = new GeneratorAdapter(writer.visitMethod(Opcodes.ACC_PUBLIC, "b",
        "()V", null, new String[0]), Opcodes.ACC_PUBLIC, "b", "()V");
    gen.visitCode();
    gen.loadThis();
    gen.getField(classType, "data", Type.getObjectType("[Z"));
    gen.push(1);
View Full Code Here

    writer.visitField(Opcodes.ACC_PRIVATE | Opcodes.ACC_FINAL, "data",
        "[Z", null, null);

    // Constructor
    GeneratorAdapter gen = new GeneratorAdapter(writer.visitMethod(
        Opcodes.ACC_PUBLIC, "<init>", "()V", null, new String[0]),
        Opcodes.ACC_PUBLIC, "<init>", "()V");
    gen.visitCode();
    gen.loadThis();
    gen.invokeConstructor(Type.getType(Object.class), new Method("<init>",
View Full Code Here

    gen.returnValue();
    gen.visitMaxs(size + 1, 0);
    gen.visitEnd();

    // get()
    gen = new GeneratorAdapter(writer.visitMethod(Opcodes.ACC_PUBLIC,
        "get", "()[Z", null, new String[0]), Opcodes.ACC_PUBLIC, "get",
        "()[Z");
    gen.visitCode();
    gen.loadThis();
    gen.getField(classType, "data", GeneratorConstants.PROBEDATA_TYPE);
View Full Code Here

    gen.returnValue();
    gen.visitMaxs(1, 0);
    gen.visitEnd();

    // a()
    gen = new GeneratorAdapter(writer.visitMethod(Opcodes.ACC_PUBLIC, "a",
        "()V", null, new String[0]), Opcodes.ACC_PUBLIC, "a", "()V");
    gen.visitCode();
    gen.loadThis();
    gen.getField(classType, "data", GeneratorConstants.PROBEDATA_TYPE);
    gen.push(0);
View Full Code Here

    gen.returnValue();
    gen.visitMaxs(3, 0);
    gen.visitEnd();

    // b()
    gen = new GeneratorAdapter(writer.visitMethod(Opcodes.ACC_PUBLIC, "b",
        "()V", null, new String[0]), Opcodes.ACC_PUBLIC, "b", "()V");
    gen.visitCode();
    gen.loadThis();
    gen.getField(classType, "data", GeneratorConstants.PROBEDATA_TYPE);
    gen.push(1);
View Full Code Here

    writer.visitField(InstrSupport.DATAFIELD_ACC,
        InstrSupport.DATAFIELD_NAME, InstrSupport.DATAFIELD_DESC, null,
        null);

    // Constructor
    GeneratorAdapter gen = new GeneratorAdapter(writer.visitMethod(
        Opcodes.ACC_PUBLIC, "<init>", "()V", null, new String[0]),
        Opcodes.ACC_PUBLIC, "<init>", "()V");
    gen.visitCode();
    gen.loadThis();
    gen.invokeConstructor(Type.getType(Object.class), new Method("<init>",
View Full Code Here

    gen.returnValue();
    gen.visitMaxs(size + 1, 0);
    gen.visitEnd();

    // get()
    gen = new GeneratorAdapter(writer.visitMethod(Opcodes.ACC_PUBLIC,
        "get", "()[Z", null, new String[0]), Opcodes.ACC_PUBLIC, "get",
        "()[Z");
    gen.visitCode();
    gen.getStatic(classType, InstrSupport.DATAFIELD_NAME,
        Type.getObjectType(InstrSupport.DATAFIELD_DESC));
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.