Package org.objectweb.asm.commons

Examples of org.objectweb.asm.commons.GeneratorAdapter.push()


      // push the method name string arg onto the stack
      staticAdapter.push(m.method.getName());

      // create an array of the method parm class[] arg
      staticAdapter.push(targetMethodParameters.length);
      staticAdapter.newArray(CLASS_TYPE);
      int index = 0;
      for (Type t : targetMethodParameters) {
        staticAdapter.dup();
        staticAdapter.push(index);
View Full Code Here


      staticAdapter.push(targetMethodParameters.length);
      staticAdapter.newArray(CLASS_TYPE);
      int index = 0;
      for (Type t : targetMethodParameters) {
        staticAdapter.dup();
        staticAdapter.push(index);
        staticAdapter.push(t);
        staticAdapter.arrayStore(CLASS_TYPE);
        index++;
      }
View Full Code Here

      staticAdapter.newArray(CLASS_TYPE);
      int index = 0;
      for (Type t : targetMethodParameters) {
        staticAdapter.dup();
        staticAdapter.push(index);
        staticAdapter.push(t);
        staticAdapter.arrayStore(CLASS_TYPE);
        index++;
      }

      // invoke the getMethod
View Full Code Here

      constructor.returnValue();
      constructor.endMethod();
     
      GeneratorAdapter gen = new GeneratorAdapter(ACC_STATIC | ACC_PUBLIC | ACC_SYNTHETIC,
          org.objectweb.asm.commons.Method.getMethod("double bar()"), null, null, classWriter);
      gen.push(2.0);
      gen.returnValue();
      gen.endMethod();     
     
      byte[] bc = classWriter.toByteArray();
      return defineClass(className, bc, 0, bc.length);
View Full Code Here

    for (CompilableGuard guard : guards) {
      guard.addGuard(returnFalse, gm, cm, sm, cw, id, cargs, Type.getType(internalClassName));
    }

    // Makes it through the guard, success
    gm.push(true);
    gm.returnValue();
    // Jumps to returnFalse, failure
    gm.visitLabel(returnFalse);
    gm.push(false);
    gm.returnValue();
View Full Code Here

    // Makes it through the guard, success
    gm.push(true);
    gm.returnValue();
    // Jumps to returnFalse, failure
    gm.visitLabel(returnFalse);
    gm.push(false);
    gm.returnValue();
    gm.endMethod();

    // Close the constructor
    cm.returnValue();
View Full Code Here

    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);
    gen.push(1);
    gen.arrayStore(Type.BOOLEAN_TYPE);
    gen.returnValue();
    gen.visitMaxs(3, 0);
    gen.visitEnd();
View Full Code Here

        "()V", null, new String[0]), Opcodes.ACC_PUBLIC, "a", "()V");
    gen.visitCode();
    gen.loadThis();
    gen.getField(classType, "data", GeneratorConstants.PROBEDATA_TYPE);
    gen.push(0);
    gen.push(1);
    gen.arrayStore(Type.BOOLEAN_TYPE);
    gen.returnValue();
    gen.visitMaxs(3, 0);
    gen.visitEnd();
View Full Code Here

    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);
    gen.push(1);
    gen.arrayStore(Type.BOOLEAN_TYPE);
    gen.returnValue();
    gen.visitMaxs(3, 0);
    gen.visitEnd();
View Full Code Here

        "()V", null, new String[0]), Opcodes.ACC_PUBLIC, "b", "()V");
    gen.visitCode();
    gen.loadThis();
    gen.getField(classType, "data", GeneratorConstants.PROBEDATA_TYPE);
    gen.push(1);
    gen.push(1);
    gen.arrayStore(Type.BOOLEAN_TYPE);
    gen.returnValue();
    gen.visitMaxs(3, 0);
    gen.visitEnd();
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.