Package org.deuce.objectweb.asm

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


   
    // 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){
      copyMethod.visitVarInsn(Opcodes.ALOAD, 0); // load this
      place = 1;
    }
   
    Type[] argumentTypes = newMethod.getArgumentTypes();
    for(int i=0 ; i<(argumentTypes.length-1) ; ++i){
View Full Code Here


    }
   
    Type[] argumentTypes = newMethod.getArgumentTypes();
    for(int i=0 ; i<(argumentTypes.length-1) ; ++i){
      Type type = argumentTypes[i];
      copyMethod.visitVarInsn(type.getOpcode(Opcodes.ILOAD), place);
      place += type.getSize();
    }
   
    // call the original method
    copyMethod.visitMethodInsn(isStatic ? Opcodes.INVOKESTATIC : Opcodes.INVOKEVIRTUAL, className, name, desc);
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

      Label l5 = new Label();
      mv.visitTryCatchBlock(l3, l4, l5, Names.Exception);
      Label l6 = new Label();
      mv.visitLabel(l6);
      //Call Super Class
      mv.visitVarInsn(ALOAD, 0);
      mv.visitMethodInsn(INVOKESPECIAL, Names.UniCastObject, "<init>", "()V");
      Label l7 = new Label();
      mv.visitLabel(l7);
 
      mv.visitMethodInsn(INVOKESTATIC, Names.Hyflow, "getLocator", Type.getMethodDescriptor(Type.getType(DirectoryManager.class), new Type [] {})); //"()Laleph/dir/DirectoryManager;");
View Full Code Here

      Label l7 = new Label();
      mv.visitLabel(l7);
 
      mv.visitMethodInsn(INVOKESTATIC, Names.Hyflow, "getLocator", Type.getMethodDescriptor(Type.getType(DirectoryManager.class), new Type [] {})); //"()Laleph/dir/DirectoryManager;");
      mv.visitTypeInsn(CHECKCAST, Names.ControlFlowDirectory);
      mv.visitVarInsn(ALOAD, 0);
      mv.visitMethodInsn(INVOKEVIRTUAL, Names.ControlFlowDirectory, "addProxy", Type.getMethodDescriptor(Type.VOID_TYPE, new Type[] {Type.getType(Object.class)})); //"(Ljava/lang/Object;)V");
      Label l8 = new Label();
      mv.visitLabel(l8);
 
      mv.visitMethodInsn(INVOKESTATIC, Names.System, "getSecurityManager", Type.getMethodDescriptor(Type.getType(SecurityManager.class), new Type[]{}));//"()Ljava/lang/SecurityManager;");
View Full Code Here

      mv.visitFrame(Opcodes.F_FULL, 1, new Object[] {proxyName}, 0, new Object[] {});
      mv.visitMethodInsn(INVOKESTATIC, Names.HyflowNetwork, "getInstance", Type.getMethodDescriptor(Type.getType(Network.class), new Type[]{}));//"()Ledu/vt/rt/hyflow/util/network/Network;");
      mv.visitMethodInsn(INVOKEVIRTUAL, Names.HyflowNetwork, "getPort", "()I");
      mv.visitIntInsn(SIPUSH, 1000);
      mv.visitInsn(IADD);
      mv.visitVarInsn(ISTORE, 1);
      Label l11 = new Label();
      mv.visitLabel(l11);
 
      mv.visitInsn(ACONST_NULL);
      mv.visitVarInsn(ASTORE, 2);
View Full Code Here

      mv.visitVarInsn(ISTORE, 1);
      Label l11 = new Label();
      mv.visitLabel(l11);
 
      mv.visitInsn(ACONST_NULL);
      mv.visitVarInsn(ASTORE, 2);
      mv.visitLabel(l0);
 
      mv.visitVarInsn(ILOAD, 1);
      mv.visitMethodInsn(INVOKESTATIC, "java/rmi/registry/LocateRegistry", "createRegistry", "(I)Ljava/rmi/registry/Registry;");
      mv.visitVarInsn(ASTORE, 2);
View Full Code Here

 
      mv.visitInsn(ACONST_NULL);
      mv.visitVarInsn(ASTORE, 2);
      mv.visitLabel(l0);
 
      mv.visitVarInsn(ILOAD, 1);
      mv.visitMethodInsn(INVOKESTATIC, "java/rmi/registry/LocateRegistry", "createRegistry", "(I)Ljava/rmi/registry/Registry;");
      mv.visitVarInsn(ASTORE, 2);
      mv.visitLabel(l1);
      mv.visitJumpInsn(GOTO, l3);
      mv.visitLabel(l2);
View Full Code Here

      mv.visitVarInsn(ASTORE, 2);
      mv.visitLabel(l0);
 
      mv.visitVarInsn(ILOAD, 1);
      mv.visitMethodInsn(INVOKESTATIC, "java/rmi/registry/LocateRegistry", "createRegistry", "(I)Ljava/rmi/registry/Registry;");
      mv.visitVarInsn(ASTORE, 2);
      mv.visitLabel(l1);
      mv.visitJumpInsn(GOTO, l3);
      mv.visitLabel(l2);

      mv.visitFrame(Opcodes.F_FULL, 3, new Object[] {proxyName, Opcodes.INTEGER, "java/rmi/registry/Registry"}, 1, new Object[] {Names.RMIException});
View Full Code Here

      mv.visitLabel(l1);
      mv.visitJumpInsn(GOTO, l3);
      mv.visitLabel(l2);

      mv.visitFrame(Opcodes.F_FULL, 3, new Object[] {proxyName, Opcodes.INTEGER, "java/rmi/registry/Registry"}, 1, new Object[] {Names.RMIException});
      mv.visitVarInsn(ASTORE, 3);
      Label l12 = new Label();
      mv.visitLabel(l12);

      mv.visitVarInsn(ALOAD, 3);
      mv.visitMethodInsn(INVOKEVIRTUAL, Names.RMIException, "printStackTrace", "()V");
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.