Package org.deuce.objectweb.asm

Examples of org.deuce.objectweb.asm.MethodVisitor.visitCode()


      String signature, String[] exceptions) {
    Method newMethod = createNewMethod(name, desc);
    final int newAccess = access & ~Opcodes.ACC_NATIVE;
    MethodVisitor copyMethod =  super.visitMethod(newAccess | Opcodes.ACC_SYNTHETIC, name, newMethod.getDescriptor(),
        signature, exceptions);
    copyMethod.visitCode();
   
    // load the arguments before calling the original method
    final boolean isStatic = (access & ~Opcodes.ACC_STATIC) != 0;
    int place = 0; // place on the stack
    if(!isStatic){
View Full Code Here


      if( !visitclinit && fields.size() > 0) { // creates a new <clinit> in case we didn't see one already.

        //TODO avoid creating new static method in case of external fields holder
        visitclinit = true;
        MethodVisitor method = visitMethod(Opcodes.ACC_STATIC, "<clinit>", "()V", null, null);
        method.visitCode();
        method.visitInsn(Opcodes.RETURN);
        method.visitMaxs(100, 100); // TODO set the right value
        method.visitEnd();

      }
View Full Code Here

      }
      if(isEnum){ // Build a dummy ordinal() method
        MethodVisitor ordinalMethod =
          super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_SYNTHETIC, "ordinal", "(Lorg/deuce/transaction/Context;)I", null, null);
        ordinalMethod.visitCode();
        ordinalMethod.visitVarInsn(Opcodes.ALOAD, 0);
        ordinalMethod.visitMethodInsn(Opcodes.INVOKEVIRTUAL, className, "ordinal", "()I");
        ordinalMethod.visitInsn(Opcodes.IRETURN);
        ordinalMethod.visitMaxs(1, 2);
        ordinalMethod.visitEnd();
View Full Code Here

    fv.visitEnd();
   
    //Add Constructor
    {
      mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, new String[] { Names.RMIException });
      mv.visitCode();
      Label l0 = new Label();
      Label l1 = new Label();
      Label l2 = new Label();
      mv.visitTryCatchBlock(l0, l1, l2, Names.RMIException);
      Label l3 = new Label();
View Full Code Here

    for(RemoteMethodDetails mD: urmdtl){
      mv = cw.visitMethod(ACC_PUBLIC, mD.rmD.name, mD.rmD.desc, null, null);
      Type[] src = Type.getArgumentTypes(mD.rmD.desc);
      Type returnType = Type.getReturnType(mD.rmD.desc);
      int callerIndex = src.length + 1//1 for this
      mv.visitCode();
      Label l0 = new Label();
      mv.visitLabel(l0);
//      mv.visitLineNumber(56, l0);
      mv.visitVarInsn(ALOAD, 2);
      mv.visitMethodInsn(INVOKEVIRTUAL, Names.ControlflowInterface, "getLastExecuter", "()Laleph/comm/Address;");
View Full Code Here

public class DefaultConstructor implements Opcodes{

  public static void addCode(ClassVisitor cw) {
    MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
    mv.visitCode();
    mv.visitVarInsn(ALOAD, 0);
    mv.visitMethodInsn(INVOKESPECIAL, Names.AbstractLoggableClass, "<init>", "()V");
    mv.visitInsn(RETURN);
    mv.visitMaxs(0,0);
    mv.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.