Package nginx.clojure.asm.tree

Examples of nginx.clojure.asm.tree.MethodInsnNode


        for(int i=0 ; i<numIns ; i++) {
            Frame f = frames[i];
            if(f != null) { // reachable ?
                AbstractInsnNode in = mn.instructions.get(i);
                if(in.getType() == AbstractInsnNode.METHOD_INSN) {
                    MethodInsnNode min = (MethodInsnNode)in;
                    int opcode = min.getOpcode();
                    if (min.owner.equals("java/lang/reflect/Method") && min.name.equals("invoke")) {
                      hasReflectInvoke = true;
                    }
                    Integer st = db.checkMethodSuspendType(min.owner, ClassEntry.key(min.name, min.desc), opcode == Opcodes.INVOKEVIRTUAL || opcode == Opcodes.INVOKESTATIC || opcode == Opcodes.INVOKEINTERFACE);
                    if(st == MethodDatabase.SUSPEND_NORMAL || st == MethodDatabase.SUSPEND_FAMILY || st == MethodDatabase.SUSPEND_JUST_MARK) {
View Full Code Here


        dumpCodeBlock(mv, 0, 0);
       
        for(int i=1 ; i<numCodeBlocks ; i++) {
            FrameInfo fi = codeBlocks[i];
           
            MethodInsnNode min = (MethodInsnNode)(mn.instructions.get(fi.endInstruction));
            if(InstrumentClass.COROUTINE_NAME.equals(min.owner) && "yield".equals(min.name)) {
                // special case - call to yield() - resume AFTER the call
                if(min.getOpcode() != Opcodes.INVOKESTATIC) {
                    throw new UnableToInstrumentException("invalid call to yield()", className, mn.name, mn.desc);
                }
               
                if (verifyVarInfoss != null) {
                  mv.visitMethodInsn(Opcodes.INVOKESTATIC, "nginx/clojure/wave/SuspendMethodVerifier", "onYield", "()V");
                }
               
                emitStoreState(mv, i, fi);
                mv.visitFieldInsn(Opcodes.GETSTATIC, STACK_NAME,
                        "exception_instance_not_for_user_code",
                        CheckInstrumentationVisitor.EXCEPTION_DESC);
                mv.visitInsn(Opcodes.ATHROW);
                min.accept(mv); // only the call
                mv.visitLabel(lMethodCalls[i-1]);
                emitRestoreState(mv, i, fi);
                dumpCodeBlock(mv, i, 1);    // skip the call
            } else {
             
View Full Code Here

                    }
                }
                break;
               
            case Opcodes.INVOKESPECIAL:
                MethodInsnNode min = (MethodInsnNode)ins;
                if("<init>".equals(min.name)) {
                    int argSize = TypeAnalyzer.getNumArguments(min.desc);
                    Frame frame = frames[i];
                    if (frame != null) {
                       int stackIndex = frame.getStackSize() - argSize - 1;
View Full Code Here

   
    public void trySplitIntoTwoNewMethods(InstrumentClass cv) throws AnalyzerException {
      int numIns = mn.instructions.size();
      int splitPos = -1;
      MethodInsnNode invokedInitInsn = null;
      for(int i = 0 ; i < numIns ; i++) {
        AbstractInsnNode insn = mn.instructions.get(i);
        if (db.meetTraceTargetClassMethod(className, mn.name)) {
          db.debug(InstrumentClass.insnToString(insn));
        }
//        System.out.println(insnToString(insn));
        if (insn instanceof MethodInsnNode) {
        MethodInsnNode minsn = (MethodInsnNode) insn;
        Frame mif = frames[i];
        if (minsn.name.equals("<init>") && mif.getLocal(0) == mif.getStack(mif.getStackSize()-1-TypeAnalyzer.getNumArguments(minsn.desc)) ) {
          splitPos = i+1;
          invokedInitInsn = minsn;
          break;
View Full Code Here

   
    int maxStack = mn.maxStack;
    for (int i = splitPos; i < numIns; i++) {
      AbstractInsnNode insn = mn.instructions.get(i);
      if (insn instanceof MethodInsnNode) {
        MethodInsnNode misn = (MethodInsnNode) insn;
        String name = misn.name;
        if (name.charAt(0) == '<' && name.charAt(1) == 'i' && db != null && db.checkMethodSuspendType(misn.owner, ClassEntry.key(name, misn.desc), false, false) == MethodDatabase.SUSPEND_NORMAL) {
          mv.visitInsn(Opcodes.ACONST_NULL);
          mv.visitMethodInsn(misn.getOpcode(), misn.owner, name, InstrumentConstructorMethod.buildShrinkedInitMethodDesc(misn.desc));
          mv.visitInsn(Opcodes.DUP);
          mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, misn.owner, InstrumentConstructorMethod.buildInitHelpMethodName(misn.desc), "()V");
          maxStack = mn.maxStack + 1;
          continue;
        }
View Full Code Here

TOP

Related Classes of nginx.clojure.asm.tree.MethodInsnNode

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.