Package org.deuce.objectweb.asm

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


   
    // call the original method
    copyMethod.visitMethodInsn(isStatic ? Opcodes.INVOKESTATIC : Opcodes.INVOKEVIRTUAL, className, name, desc);
    TypeCodeResolver returnReolver = TypeCodeResolverFactory.getReolver(newMethod.getReturnType());
    if( returnReolver == null) {
      copyMethod.visitInsn( Opcodes.RETURN); // return;
    }else {
      copyMethod.visitInsn(returnReolver.returnCode());
    }
    copyMethod.visitMaxs(1, 1);
    copyMethod.visitEnd();
View Full Code Here


    copyMethod.visitMethodInsn(isStatic ? Opcodes.INVOKESTATIC : Opcodes.INVOKEVIRTUAL, className, name, desc);
    TypeCodeResolver returnReolver = TypeCodeResolverFactory.getReolver(newMethod.getReturnType());
    if( returnReolver == null) {
      copyMethod.visitInsn( Opcodes.RETURN); // return;
    }else {
      copyMethod.visitInsn(returnReolver.returnCode());
    }
    copyMethod.visitMaxs(1, 1);
    copyMethod.visitEnd();
  }
View Full Code Here

        //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();

      }
      if(isEnum){ // Build a dummy ordinal() method
View Full Code Here

        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

      mv.visitJumpInsn(IFNONNULL, l9);
      Label l10 = new Label();
      mv.visitLabel(l10);
 
      mv.visitTypeInsn(NEW, Names.RMISecurityManager);
      mv.visitInsn(DUP);
      mv.visitMethodInsn(INVOKESPECIAL, Names.RMISecurityManager, "<init>", "()V");
      mv.visitMethodInsn(INVOKESTATIC, Names.System, "setSecurityManager", Type.getMethodDescriptor(Type.VOID_TYPE, new Type[] {Type.getType(SecurityManager.class)}));//"(Ljava/lang/SecurityManager;)V");
      mv.visitLabel(l9);
   
      mv.visitFrame(Opcodes.F_FULL, 1, new Object[] {proxyName}, 0, new Object[] {});
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);
View Full Code Here

      mv.visitInsn(IADD);
      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;");
View Full Code Here

      mv.visitMethodInsn(INVOKEVIRTUAL, Names.RMIException, "printStackTrace", "()V");
      mv.visitLabel(l3);

      mv.visitFrame(Opcodes.F_SAME, 0, null, 0, null);
      mv.visitVarInsn(ALOAD, 0);
      mv.visitInsn(ICONST_1);
      mv.visitMethodInsn(INVOKESTATIC, Names.UniCastObject, "unexportObject", "(Ljava/rmi/Remote;Z)Z");
      mv.visitInsn(POP);
      mv.visitLabel(l4);
      Label l13 = new Label();
      mv.visitJumpInsn(GOTO, l13);
View Full Code Here

      mv.visitFrame(Opcodes.F_SAME, 0, null, 0, null);
      mv.visitVarInsn(ALOAD, 0);
      mv.visitInsn(ICONST_1);
      mv.visitMethodInsn(INVOKESTATIC, Names.UniCastObject, "unexportObject", "(Ljava/rmi/Remote;Z)Z");
      mv.visitInsn(POP);
      mv.visitLabel(l4);
      Label l13 = new Label();
      mv.visitJumpInsn(GOTO, l13);
      mv.visitLabel(l5);
View Full Code Here

      mv.visitMethodInsn(INVOKESTATIC, "edu/vt/rt/hyflow/util/io/Logger", "error", "(Ljava/lang/String;)V");
      mv.visitLabel(l13);

      mv.visitFrame(Opcodes.F_SAME, 0, null, 0, null);
      mv.visitVarInsn(ALOAD, 0);
      mv.visitInsn(ICONST_0);
      mv.visitMethodInsn(INVOKESTATIC, "java/rmi/server/UnicastRemoteObject", "exportObject", "(Ljava/rmi/Remote;I)Ljava/rmi/Remote;");
      mv.visitTypeInsn(CHECKCAST, proxyIName);
      mv.visitVarInsn(ASTORE, 3);
      Label l15 = new Label();
      mv.visitLabel(l15);
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.