Package net.sf.joafip.asm

Examples of net.sf.joafip.asm.Label


          null, null);
      mv.visitCode();
      mv.visitFrame(Opcodes.F_NEW, 0, new Object[] {}, 0, new Object[] {});
      mv.visitVarInsn(ALOAD, 0);
      mv.visitVarInsn(ALOAD, 1);
      Label l0 = new Label();
      mv.visitJumpInsn(IF_ACMPNE, l0);
      mv.visitInsn(ICONST_1);
      Label l1 = new Label();
      mv.visitJumpInsn(GOTO, l1);
      mv.visitLabel(l0);
      mv.visitFrame(Opcodes.F_NEW, 2, new Object[] { "java/lang/Object",
          "java/lang/Object" }, 0, new Object[] {});
      mv.visitInsn(ICONST_0);
      mv.visitLabel(l1);
      mv.visitFrame(Opcodes.F_NEW, 2, new Object[] { "java/lang/Object",
          "java/lang/Object" }, 1, new Object[] { Opcodes.INTEGER });
      mv.visitInsn(IRETURN);
      mv.visitMaxs(2, 2);
      mv.visitEnd();
    }
    {
      mv = cw.visitMethod(ACC_PROTECTED + ACC_NATIVE, "clone",
          "()Ljava/lang/Object;", null,
          new String[] { "java/lang/CloneNotSupportedException" });
      mv.visitEnd();
    }
    {
      mv = cw.visitMethod(ACC_PUBLIC, "toString", "()Ljava/lang/String;",
          null, null);
      mv.visitCode();
      mv.visitTypeInsn(NEW, "java/lang/StringBuilder");
      mv.visitInsn(DUP);
      mv.visitMethodInsn(INVOKESPECIAL, "java/lang/StringBuilder",
          "<init>", "()V");
      mv.visitVarInsn(ALOAD, 0);
      mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Object", "getClass",
          "()Ljava/lang/Class;");
      mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Class", "getName",
          "()Ljava/lang/String;");
      mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder",
          "append", "(Ljava/lang/String;)Ljava/lang/StringBuilder;");
      mv.visitLdcInsn("@");
      mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder",
          "append", "(Ljava/lang/String;)Ljava/lang/StringBuilder;");
      mv.visitVarInsn(ALOAD, 0);
      mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Object", "hashCode",
          "()I");
      mv.visitMethodInsn(INVOKESTATIC, "java/lang/Integer",
          "toHexString", "(I)Ljava/lang/String;");
      mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder",
          "append", "(Ljava/lang/String;)Ljava/lang/StringBuilder;");
      mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder",
          "toString", "()Ljava/lang/String;");
      mv.visitInsn(ARETURN);
      mv.visitMaxs(2, 1);
      mv.visitEnd();
    }
    {
      mv = cw.visitMethod(ACC_PUBLIC + ACC_FINAL + ACC_NATIVE, "notify",
          "()V", null, null);
      mv.visitEnd();
    }
    {
      mv = cw.visitMethod(ACC_PUBLIC + ACC_FINAL + ACC_NATIVE,
          "notifyAll", "()V", null, null);
      mv.visitEnd();
    }
    {
      mv = cw.visitMethod(ACC_PUBLIC + ACC_FINAL + ACC_NATIVE, "wait",
          "(J)V", null,
          new String[] { "java/lang/InterruptedException" });
      mv.visitEnd();
    }
    {
      mv = cw.visitMethod(ACC_PUBLIC + ACC_FINAL, "wait", "(JI)V", null,
          new String[] { "java/lang/InterruptedException" });
      mv.visitCode();
      mv.visitFrame(Opcodes.F_NEW, 0, new Object[] {}, 0, new Object[] {});
      mv.visitVarInsn(LLOAD, 1);
      mv.visitInsn(LCONST_0);
      mv.visitInsn(LCMP);
      Label l0 = new Label();
      mv.visitJumpInsn(IFGE, l0);
      mv.visitTypeInsn(NEW, "java/lang/IllegalArgumentException");
      mv.visitInsn(DUP);
      mv.visitLdcInsn("timeout value is negative");
      mv.visitMethodInsn(INVOKESPECIAL,
          "java/lang/IllegalArgumentException", "<init>",
          "(Ljava/lang/String;)V");
      mv.visitInsn(ATHROW);
      mv.visitLabel(l0);
      mv.visitFrame(Opcodes.F_NEW, 3, new Object[] { "java/lang/Object",
          Opcodes.LONG, Opcodes.INTEGER }, 0, new Object[] {});
      mv.visitVarInsn(ILOAD, 3);
      Label l1 = new Label();
      mv.visitJumpInsn(IFLT, l1);
      mv.visitVarInsn(ILOAD, 3);
      mv.visitLdcInsn(new Integer(999999));
      Label l2 = new Label();
      mv.visitJumpInsn(IF_ICMPLE, l2);
      mv.visitLabel(l1);
      mv.visitFrame(Opcodes.F_NEW, 3, new Object[] { "java/lang/Object",
          Opcodes.LONG, Opcodes.INTEGER }, 0, new Object[] {});
      mv.visitTypeInsn(NEW, "java/lang/IllegalArgumentException");
      mv.visitInsn(DUP);
      mv.visitLdcInsn("nanosecond timeout value out of range");
      mv.visitMethodInsn(INVOKESPECIAL,
          "java/lang/IllegalArgumentException", "<init>",
          "(Ljava/lang/String;)V");
      mv.visitInsn(ATHROW);
      mv.visitLabel(l2);
      mv.visitFrame(Opcodes.F_NEW, 3, new Object[] { "java/lang/Object",
          Opcodes.LONG, Opcodes.INTEGER }, 0, new Object[] {});
      mv.visitVarInsn(ILOAD, 3);
      mv.visitLdcInsn(new Integer(500000));
      Label l3 = new Label();
      mv.visitJumpInsn(IF_ICMPGE, l3);
      mv.visitVarInsn(ILOAD, 3);
      Label l4 = new Label();
      mv.visitJumpInsn(IFEQ, l4);
      mv.visitVarInsn(LLOAD, 1);
      mv.visitInsn(LCONST_0);
      mv.visitInsn(LCMP);
      mv.visitJumpInsn(IFNE, l4);
      mv.visitLabel(l3);
      mv.visitFrame(Opcodes.F_NEW, 3, new Object[] { "java/lang/Object",
          Opcodes.LONG, Opcodes.INTEGER }, 0, new Object[] {});
      mv.visitVarInsn(LLOAD, 1);
      mv.visitInsn(LCONST_1);
      mv.visitInsn(LADD);
      mv.visitVarInsn(LSTORE, 1);
      mv.visitLabel(l4);
      mv.visitFrame(Opcodes.F_NEW, 3, new Object[] { "java/lang/Object",
          Opcodes.LONG, Opcodes.INTEGER }, 0, new Object[] {});
      mv.visitVarInsn(ALOAD, 0);
      mv.visitVarInsn(LLOAD, 1);
      mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Object", "wait",
          "(J)V");
      mv.visitInsn(RETURN);
      mv.visitMaxs(4, 4);
      mv.visitEnd();
    }
    {
      mv = cw.visitMethod(ACC_PUBLIC + ACC_FINAL, "wait", "()V", null,
          new String[] { "java/lang/InterruptedException" });
      mv.visitCode();
      mv.visitVarInsn(ALOAD, 0);
      mv.visitInsn(LCONST_0);
      mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Object", "wait",
          "(J)V");
      mv.visitInsn(RETURN);
      mv.visitMaxs(3, 1);
      mv.visitEnd();
    }
    {
      mv = cw.visitMethod(ACC_PROTECTED, "finalize", "()V", null,
          new String[] { "java/lang/Throwable" });
      mv.visitCode();
      mv.visitInsn(RETURN);
      mv.visitMaxs(0, 1);
      mv.visitEnd();
    }
    {
      mv = cw.visitMethod(ACC_STATIC, "<clinit>", "()V", null, null);
      mv.visitCode();
      mv.visitMethodInsn(INVOKESTATIC, "java/lang/Object",
          "registerNatives", "()V");
      mv.visitInsn(RETURN);
      mv.visitMaxs(0, 0);
      mv.visitEnd();
    }
    {
      mv = cw.visitMethod(ACC_PRIVATE, "forceLoad$JOAFIP$",
          "(Ljava/lang/Object;)V", null, null);
      mv.visitCode();
      Label l0 = new Label();
      Label l1 = new Label();
      Label l2 = new Label();
      mv.visitTryCatchBlock(l0, l1, l2, "java/lang/Exception");
      mv.visitFrame(Opcodes.F_NEW, 0, new Object[] {}, 0, new Object[] {});
      mv.visitVarInsn(ALOAD, 1);
      mv.visitVarInsn(ALOAD, 0);
      Label l3 = new Label();
      mv.visitJumpInsn(IF_ACMPEQ, l3);
      mv.visitLabel(l0);
      mv.visitVarInsn(ALOAD, 1);
      mv.visitMethodInsn(INVOKESTATIC,
          "net/sf/joafip/store/service/proxy/ProxyManager2",
View Full Code Here


          "Lnet/sf/joafip/store/service/proxy/IProxyCallBackToImplement;");
      mv.visitFieldInsn(GETSTATIC,
          "net/sf/joafip/store/service/proxy/NullProxyCallBack",
          "INSTANCE",
          "Lnet/sf/joafip/store/service/proxy/NullProxyCallBack;");
      Label l0 = new Label();
      mv.visitJumpInsn(IF_ACMPEQ, l0);
      mv.visitVarInsn(ALOAD, 0);
      mv.visitFieldInsn(GETFIELD,
          "net/sf/joafip/store/service/proxy/JoafipObject",
          "proxyCallBack",
          "Lnet/sf/joafip/store/service/proxy/IProxyCallBackToImplement;");
      mv.visitJumpInsn(IFNULL, l0);
      mv.visitTypeInsn(NEW, "java/lang/IllegalStateException");
      mv.visitInsn(DUP);
      mv.visitTypeInsn(NEW, "java/lang/StringBuilder");
      mv.visitInsn(DUP);
      mv.visitLdcInsn("for ");
      mv.visitMethodInsn(INVOKESPECIAL, "java/lang/StringBuilder",
          "<init>", "(Ljava/lang/String;)V");
      mv.visitVarInsn(ALOAD, 0);
      mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Object", "getClass",
          "()Ljava/lang/Class;");
      mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder",
          "append", "(Ljava/lang/Object;)Ljava/lang/StringBuilder;");
      mv.visitLdcInsn("@");
      mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder",
          "append", "(Ljava/lang/String;)Ljava/lang/StringBuilder;");
      mv.visitVarInsn(ALOAD, 0);
      mv.visitMethodInsn(INVOKESTATIC, "java/lang/System",
          "identityHashCode", "(Ljava/lang/Object;)I");
      mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder",
          "append", "(I)Ljava/lang/StringBuilder;");
      mv.visitLdcInsn(" proxy call back already set to ");
      mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder",
          "append", "(Ljava/lang/String;)Ljava/lang/StringBuilder;");
      mv.visitVarInsn(ALOAD, 0);
      mv.visitFieldInsn(GETFIELD,
          "net/sf/joafip/store/service/proxy/JoafipObject",
          "proxyCallBack",
          "Lnet/sf/joafip/store/service/proxy/IProxyCallBackToImplement;");
      mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder",
          "append", "(Ljava/lang/Object;)Ljava/lang/StringBuilder;");
      mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder",
          "toString", "()Ljava/lang/String;");
      mv.visitVarInsn(ALOAD, 0);
      mv.visitFieldInsn(GETFIELD,
          "net/sf/joafip/store/service/proxy/JoafipObject",
          "setProxyCallBackTrace", "Ljava/lang/Exception;");
      mv.visitMethodInsn(INVOKESPECIAL,
          "java/lang/IllegalStateException", "<init>",
          "(Ljava/lang/String;Ljava/lang/Throwable;)V");
      mv.visitInsn(ATHROW);
      mv.visitLabel(l0);
      mv.visitFrame(Opcodes.F_SAME, 0, null, 0, null);
      mv.visitVarInsn(ALOAD, 1);
      Label l1 = new Label();
      mv.visitJumpInsn(IFNONNULL, l1);
      mv.visitTypeInsn(NEW, "java/lang/IllegalArgumentException");
      mv.visitInsn(DUP);
      mv.visitLdcInsn("argument can not be null");
      mv.visitMethodInsn(INVOKESPECIAL,
          "java/lang/IllegalArgumentException", "<init>",
          "(Ljava/lang/String;)V");
      mv.visitInsn(ATHROW);
      mv.visitLabel(l1);
      mv.visitFrame(Opcodes.F_SAME, 0, null, 0, null);
      mv.visitVarInsn(ALOAD, 0);
      mv.visitVarInsn(ALOAD, 1);
      mv.visitFieldInsn(PUTFIELD,
          "net/sf/joafip/store/service/proxy/JoafipObject",
          "proxyCallBack",
          "Lnet/sf/joafip/store/service/proxy/IProxyCallBackToImplement;");
      mv.visitVarInsn(ALOAD, 0);
      mv.visitTypeInsn(NEW, "java/lang/Exception");
      mv.visitInsn(DUP);
      mv.visitLdcInsn("setted proxy call back trace");
      mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Exception", "<init>",
          "(Ljava/lang/String;)V");
      mv.visitFieldInsn(PUTFIELD,
          "net/sf/joafip/store/service/proxy/JoafipObject",
          "setProxyCallBackTrace", "Ljava/lang/Exception;");
      mv.visitInsn(RETURN);
      mv.visitMaxs(5, 2);
      mv.visitEnd();
    }
    {
      mv = cw.visitMethod(
          ACC_PUBLIC,
          "setIsLoaded$JOAFIP$",
          "()V",
          null,
          new String[] { "net/sf/joafip/store/service/objectio/ObjectIOException" });
      mv.visitCode();
      mv.visitVarInsn(ALOAD, 0);
      mv.visitFieldInsn(GETFIELD,
          "net/sf/joafip/store/service/proxy/JoafipObject",
          "proxyCallBack",
          "Lnet/sf/joafip/store/service/proxy/IProxyCallBackToImplement;");
      mv.visitMethodInsn(
          INVOKEINTERFACE,
          "net/sf/joafip/store/service/proxy/IProxyCallBackToImplement",
          "setIsLoaded$JOAFIP$", "()V");
      mv.visitInsn(RETURN);
      mv.visitMaxs(2, 2);
      mv.visitEnd();
    }
    {
      mv = cw.visitMethod(ACC_PUBLIC, "setLoading$JOAFIP$", "(Z)V", null,
          null);
      mv.visitCode();
      mv.visitVarInsn(ALOAD, 0);
      mv.visitFieldInsn(GETFIELD,
          "net/sf/joafip/store/service/proxy/JoafipObject",
          "proxyCallBack",
          "Lnet/sf/joafip/store/service/proxy/IProxyCallBackToImplement;");
      mv.visitVarInsn(ILOAD, 1);
      mv.visitMethodInsn(
          INVOKEINTERFACE,
          "net/sf/joafip/store/service/proxy/IProxyCallBackToImplement",
          "setLoading$JOAFIP$", "(Z)V");
      mv.visitInsn(RETURN);
      mv.visitMaxs(2, 2);
      mv.visitEnd();
    }
    {
      mv = cw.visitMethod(ACC_PUBLIC, "intercept$JOAFIP$", "()V", null,
          null);
      mv.visitCode();
      mv.visitVarInsn(ALOAD, 0);
      mv.visitFieldInsn(GETFIELD,
          "net/sf/joafip/store/service/proxy/JoafipObject",
          "proxyCallBack",
          "Lnet/sf/joafip/store/service/proxy/IProxyCallBackToImplement;");
      mv.visitMethodInsn(
          INVOKEINTERFACE,
          "net/sf/joafip/store/service/proxy/IProxyCallBackToImplement",
          "intercept$JOAFIP$", "()V");
      mv.visitInsn(RETURN);
      mv.visitMaxs(1, 1);
      mv.visitEnd();
    }
    {
      mv = cw.visitMethod(ACC_PUBLIC, "methodEnd$JOAFIP$", "()V", null,
          null);
      mv.visitCode();
      mv.visitVarInsn(ALOAD, 0);
      mv.visitFieldInsn(GETFIELD,
          "net/sf/joafip/store/service/proxy/JoafipObject",
          "proxyCallBack",
          "Lnet/sf/joafip/store/service/proxy/IProxyCallBackToImplement;");
      mv.visitMethodInsn(
          INVOKEINTERFACE,
          "net/sf/joafip/store/service/proxy/IProxyCallBackToImplement",
          "methodEnd$JOAFIP$", "()V");
      mv.visitInsn(RETURN);
      mv.visitMaxs(1, 1);
      mv.visitEnd();
    }
    {
      mv = cw.visitMethod(ACC_PROTECTED, "forceLoad$JOAFIP$",
          "(Ljava/lang/Object;)V", null, null);
      mv.visitCode();
      Label l0 = new Label();
      Label l1 = new Label();
      Label l2 = new Label();
      mv.visitTryCatchBlock(l0, l1, l2, "java/lang/Exception");
      mv.visitVarInsn(ALOAD, 1);
      mv.visitVarInsn(ALOAD, 0);
      Label l3 = new Label();
      mv.visitJumpInsn(IF_ACMPEQ, l3);
      mv.visitLabel(l0);
      mv.visitVarInsn(ALOAD, 1);
      mv.visitMethodInsn(INVOKESTATIC,
          "net/sf/joafip/store/service/proxy/ProxyManager2",
View Full Code Here

    return LABEL;
  }

  public Label getLabel() {
    if (label == null) {
      label = new Label();
    }
    return label;
  }
View Full Code Here

    }
    {
      mv = cw.visitMethod(ACC_PRIVATE, "invokeStatic",
          "(Ljava/lang/Object;Ljava/lang/String;)V", null, null);
      mv.visitCode();
      Label l0 = new Label();
      Label l1 = new Label();
      Label l2 = new Label();
      mv.visitTryCatchBlock(l0, l1, l2, "java/lang/Exception");
      mv.visitLabel(l0);
      mv.visitLdcInsn("net.sf.joafip.store.service.proxy.StaticProxyCallBack");
      mv.visitMethodInsn(INVOKESTATIC, "java/lang/Class", "forName",
          "(Ljava/lang/String;)Ljava/lang/Class;");
      mv.visitVarInsn(ASTORE, 3);
      mv.visitVarInsn(ALOAD, 3);
      mv.visitVarInsn(ALOAD, 2);
      mv.visitInsn(ICONST_1);
      mv.visitTypeInsn(ANEWARRAY, "java/lang/Class");
      mv.visitInsn(DUP);
      mv.visitInsn(ICONST_0);
      mv.visitLdcInsn(Type.getType("Ljava/lang/Object;"));
      mv.visitInsn(AASTORE);
      mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Class", "getMethod",
          "(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;");
      mv.visitVarInsn(ASTORE, 4);
      mv.visitVarInsn(ALOAD, 4);
      mv.visitInsn(ACONST_NULL);
      mv.visitInsn(ICONST_1);
      mv.visitTypeInsn(ANEWARRAY, "java/lang/Object");
      mv.visitInsn(DUP);
      mv.visitInsn(ICONST_0);
      mv.visitVarInsn(ALOAD, 1);
      mv.visitInsn(AASTORE);
      mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/reflect/Method",
          "invoke",
          "(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;");
      mv.visitInsn(POP);
      mv.visitLabel(l1);
      Label l3 = new Label();
      mv.visitJumpInsn(GOTO, l3);
      mv.visitLabel(l2);
      mv.visitFrame(Opcodes.F_SAME1, 0, null, 1,
          new Object[] { "java/lang/Exception" });
      mv.visitVarInsn(ASTORE, 3);
View Full Code Here

      }
    }
  }

  private void prepareTryFinally() {
    label0 = new Label();
    assert label1 == null : "try catch block already defined";
    label2 = new Label();
    label1 = new Label();
    methodVisitor.visitLabel(label0);
  }
View Full Code Here

    if (surroundInvoke) {
      methodVisitor.visitMethodInsn(
      /**/INVOKESTATIC, JOAFIP_CALL_BACK, INVOKE_BEGIN$JOAFIP$,
          NO_ARG_V_DESC);
      final Label labelBegin = new Label();
      final Label labelFinally = new Label();
      final Label labelResume = new Label();
      // methodVisitor.visitTryCatchBlock(labelBegin, labelFinally,
      // labelFinally, null);
      invokeTryCatchBlockList.add(new TryCatchBlock(labelBegin,
          labelFinally, labelFinally, null));
      methodVisitor.visitLabel(labelBegin);
View Full Code Here

  public void visitTypeInsn(final int opcode, final String type) {
    if (storableAccess() && opcode == NEW) {
      methodVisitor.visitMethodInsn(
      /**/INVOKESTATIC, JOAFIP_CALL_BACK, INVOKE_BEGIN$JOAFIP$,
          NO_ARG_V_DESC);
      final Label labelBegin = new Label();
      final Label labelFinally = new Label();
      final Label labelResume = new Label();
      // methodVisitor.visitTryCatchBlock(labelBegin, labelFinally,
      // labelFinally, null);
      invokeTryCatchBlockList.add(new TryCatchBlock(labelBegin,
          labelFinally, labelFinally, null));
      methodVisitor.visitLabel(labelBegin);
View Full Code Here

  public void visitLdcInsn(final Object cst) {
    if (storableAccess() && Type.class.equals(cst.getClass())) {
      methodVisitor.visitMethodInsn(
      /**/INVOKESTATIC, JOAFIP_CALL_BACK, INVOKE_BEGIN$JOAFIP$,
          NO_ARG_V_DESC);
      final Label labelBegin = new Label();
      final Label labelFinally = new Label();
      final Label labelResume = new Label();
      invokeTryCatchBlockList.add(new TryCatchBlock(labelBegin,
          labelFinally, labelFinally, null));
      methodVisitor.visitLabel(labelBegin);

      // original invoke
View Full Code Here

      methodVisitor.visitFieldInsn(opcode, owner, name, desc);
    } else if (opcode == GETSTATIC || opcode == PUTSTATIC) {
      methodVisitor.visitMethodInsn(
      /**/INVOKESTATIC, JOAFIP_CALL_BACK, INVOKE_BEGIN$JOAFIP$,
          NO_ARG_V_DESC);
      final Label labelBegin = new Label();
      final Label labelFinally = new Label();
      final Label labelResume = new Label();
      invokeTryCatchBlockList.add(new TryCatchBlock(labelBegin,
          labelFinally, labelFinally, null));
      methodVisitor.visitLabel(labelBegin);

      // original invoke
View Full Code Here

      /**/null,
      /**/exceptions);

      methodVisitor.visitCode();

      final Label label0 = new Label();
      final Label label1 = new Label();
      final Label label2 = new Label();
      methodVisitor.visitTryCatchBlock(label0, label1, label2, null);

      methodVisitor.visitLabel(label0);
      methodVisitor.visitVarInsn(ALOAD, 0);
      methodVisitor.visitMethodInsn(
View Full Code Here

TOP

Related Classes of net.sf.joafip.asm.Label

Copyright © 2018 www.massapicom. 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.