Package org.objectweb.asm.commons

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


      GeneratorAdapter constructor = new GeneratorAdapter(ACC_PRIVATE | ACC_SYNTHETIC, m, null, null, classWriter);
      constructor.loadThis();
      constructor.loadArgs();
      constructor.invokeConstructor(Type.getType(Object.class), m);
      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();
View Full Code Here


     
      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

      cm.endMethod();

      // Load writer and return it
      gm.loadLocal(writerLocal);
      gm.returnValue();
      gm.endMethod();
    }

    cw.visitEnd();
    Class<?> aClass = GuardCompiler.defineClass(className, cw.toByteArray());
    try {
View Full Code Here

    gm.returnValue();
    // Jumps to returnFalse, failure
    gm.visitLabel(returnFalse);
    gm.push(false);
    gm.returnValue();
    gm.endMethod();

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

        GeneratorAdapter adapter = new GeneratorAdapter(ACC_PUBLIC, Method.getMethod("void " + irMethod.getName() + " ()"), null, null, cls());
        adapter.loadThis();
        adapter.loadArgs();
        adapter.invokeStatic(Type.getType(Object.class), Method.getMethod("Object __ruby__" + irMethod.getName() + " (Object)"));
        adapter.returnValue();
        adapter.endMethod();
    }

    public void emitDEF_CLS_METH(DefineClassMethodInstr instr) {
        IRMethod irMethod = instr.method;
        GeneratorAdapter adapter = new GeneratorAdapter(ACC_PUBLIC | ACC_STATIC, Method.getMethod("void " + irMethod.getName() + " ()"), null, null, cls());
View Full Code Here

    public void emitDEF_CLS_METH(DefineClassMethodInstr instr) {
        IRMethod irMethod = instr.method;
        GeneratorAdapter adapter = new GeneratorAdapter(ACC_PUBLIC | ACC_STATIC, Method.getMethod("void " + irMethod.getName() + " ()"), null, null, cls());
        adapter.returnValue();
        adapter.endMethod();
    }

    public void emitJUMP(JumpInstr jump) {
        method().goTo(getLabel(jump.target));
    }
View Full Code Here

        GeneratorAdapter adapter = new GeneratorAdapter(ACC_PUBLIC, Method.getMethod("void " + irMethod.getName() + " ()"), null, null, cls());
        adapter.loadThis();
        adapter.loadArgs();
        adapter.invokeStatic(Type.getType(Object.class), Method.getMethod("Object __ruby__" + irMethod.getName() + " (Object)"));
        adapter.returnValue();
        adapter.endMethod();
    }

    public void emitDEF_CLS_METH(DefineClassMethodInstr instr) {
        IRMethod irMethod = instr.method;
        GeneratorAdapter adapter = new GeneratorAdapter(ACC_PUBLIC | ACC_STATIC, Method.getMethod("void " + irMethod.getName() + " ()"), null, null, cls());
View Full Code Here

    public void emitDEF_CLS_METH(DefineClassMethodInstr instr) {
        IRMethod irMethod = instr.method;
        GeneratorAdapter adapter = new GeneratorAdapter(ACC_PUBLIC | ACC_STATIC, Method.getMethod("void " + irMethod.getName() + " ()"), null, null, cls());
        adapter.returnValue();
        adapter.endMethod();
    }

    public void emitJUMP(JumpInstr jump) {
        method().goTo(getLabel(jump.target));
    }
View Full Code Here

        generateProxyMethods(superClass, methods, selfType, cw, clazzInit);

        // finish class initializer
        clazzInit.returnValue();
        clazzInit.endMethod();

        // end class
        cw.visitEnd();

        byte[] data = cw.toByteArray();
View Full Code Here

        gh.loadThis();
        gh.getField(selfType, INVOCATION_HANDLER_FIELD_NAME,
                INVOCATION_HANDLER_TYPE);
        gh.returnValue();
        gh.endMethod();
    }

    private static void generateGetProxyClass(Type selfType, ClassVisitor cw) {
        // make getter for proxy class
        GeneratorAdapter gpc = new GeneratorAdapter(Opcodes.ACC_PUBLIC,
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.