Examples of MethodInsnNode


Examples of org.objectweb.asm.tree.MethodInsnNode


    public boolean isGetCurrentTask() {
        AbstractInsnNode ain = getInstruction(startPos);
        if (ain.getOpcode() == INVOKESTATIC) {
            MethodInsnNode min = (MethodInsnNode)ain;
            return min.owner.equals(TASK_CLASS) && min.name.equals("getCurrentTask");
        }
        return false;
    }
View Full Code Here

Examples of org.objectweb.asm.tree.MethodInsnNode

        Collections.sort(bbs);
        indent(2);
        for (BasicBlock bb: bbs) {
            AbstractInsnNode ainode = bb.getInstruction(bb.startPos);
            if (ainode instanceof MethodInsnNode) {
                MethodInsnNode m = (MethodInsnNode)ainode;
                int n = getNumArgs(m); // This many will get consumed from stack
                pn("Call(" + n + "): " + m.owner + "." + m.name + m.desc);
                indent(2);
                pn("Inframe: ");
                indent(2);
View Full Code Here

Examples of org.objectweb.asm.tree.MethodInsnNode

            if (nInstruction.getOpcode() == Opcodes.NEW) {
              nUninitCount++;
            }
          }
          if (oInstruction.getType() == AbstractInsnNode.METHOD_INSN) {
            MethodInsnNode mi = (MethodInsnNode) oInstruction;
            if (mi.getOpcode() == INVOKESPECIAL && mi.name.equals("<init>")) {
              if (oUninitCount == 0) {
                // this is the one!
                oInvokeSpecialDescriptor = mi.desc;
              } else {
                oUninitCount--;
              }
            }
          }
          if (nInstruction.getType() == AbstractInsnNode.METHOD_INSN) {
            MethodInsnNode mi = (MethodInsnNode) nInstruction;
            if (mi.getOpcode() == INVOKESPECIAL && mi.name.equals("<init>")) {
              if (nUninitCount == 0) {
                // this is the one!
                nInvokeSpecialDescriptor = mi.desc;
              } else {
                nUninitCount--;
View Full Code Here

Examples of org.objectweb.asm.tree.MethodInsnNode

    FieldInsnNode ni = (FieldInsnNode) n;
    return oi.name.equals(ni.name) && oi.desc.equals(ni.desc) && oi.owner.equals(ni.owner);
  }

  private static boolean sameMethodInsnNode(AbstractInsnNode o, AbstractInsnNode n) {
    MethodInsnNode oi = (MethodInsnNode) o;
    if (!(n instanceof MethodInsnNode)) {
      return false;
    }
    MethodInsnNode ni = (MethodInsnNode) n;
    return oi.name.equals(ni.name) && oi.desc.equals(ni.desc) && oi.owner.equals(ni.owner);
  }
View Full Code Here

Examples of org.objectweb.asm.tree.MethodInsnNode

            VarInsnNode vi = null;
            TypeInsnNode ti = null;
            FieldInsnNode fi = null;
            String tidesc = null;
            MethodInsnNode mi = null;
            Type midesc = null;

            switch (anode.getType()) {
                case AbstractInsnNode.VAR_INSN:
                    vi = (VarInsnNode) anode;
View Full Code Here

Examples of org.objectweb.asm.tree.MethodInsnNode

        int accum=0;

        for (int i = 0; i < insnList.length; i++) {
            AbstractInsnNode ai = insnList[i];
            MethodInsnNode mi;
            int size = insnSize(ai);

            // some of these require special handling
            switch (ai.getOpcode()) {
                case Opcodes.RETURN:
View Full Code Here

Examples of org.objectweb.asm.tree.MethodInsnNode

                return;
            }
        }

        if (opc == Opcodes.INVOKESPECIAL) {
            MethodInsnNode mi = (MethodInsnNode)ai;
            Frame f1 = types[iix];
            Frame f2 = types[iix+1];
            String uninit = f1.stack[f2.sp];
            if (mi.name.equals("<init>") && spilledUTypes.contains(uninit)) {
                if (!f2.stack[f2.sp-1].equals(uninit)) throw new RuntimeException("general case of INVOKESPECIAL spill not implemented");
View Full Code Here

Examples of org.objectweb.asm.tree.MethodInsnNode

            instructions.add(new VarInsnNode(Opcodes.ILOAD, 1));
            instructions.add(intNode(firstJump.get(i)));
            instructions.add(new JumpInsnNode(Opcodes.IF_ICMPLT, not_my_problem));
            instructions.add(new VarInsnNode(Opcodes.ILOAD, 1));
            instructions.add(new VarInsnNode(Opcodes.ALOAD, 0));
            instructions.add(new MethodInsnNode(Opcodes.INVOKESTATIC, tgtype, name + "$f" + i, "(I[Ljava/lang/Object;)I"));
            instructions.add(new VarInsnNode(Opcodes.ISTORE, 1));
            instructions.add(new JumpInsnNode(Opcodes.GOTO, loop));
            instructions.add(not_my_problem);
        }

        // time for return
        String rty = null, unboxName = null, unboxDesc = null;
        int retinst;
        Type rtyty = Type.getReturnType(desc);
        switch (rtyty.getSort()) {
            case Type.VOID:
                retinst = Opcodes.RETURN; break;
            case Type.BOOLEAN:
            case Type.CHAR:
            case Type.INT:
            case Type.SHORT:
            case Type.BYTE:
                retinst = Opcodes.IRETURN; rty = "java/lang/Integer"; unboxName = "intValue"; unboxDesc = "()I"; break;
            case Type.LONG:
                retinst = Opcodes.LRETURN; rty = "java/lang/Long"; unboxName = "longValue"; unboxDesc = "()J"; break;
            case Type.FLOAT:
                retinst = Opcodes.FRETURN; rty = "java/lang/Float"; unboxName = "floatValue"; unboxDesc = "()F"; break;
            case Type.DOUBLE:
                retinst = Opcodes.DRETURN; rty = "java/lang/Double"; unboxName = "doubleValue"; unboxDesc = "()D"; break;
            default:
                retinst = Opcodes.ARETURN; rty = rtyty.getInternalName(); break;
        }

        if (rty != null) {
            instructions.add(new VarInsnNode(Opcodes.ALOAD, 0));
            instructions.add(new InsnNode(Opcodes.ICONST_0));
            instructions.add(new InsnNode(Opcodes.AALOAD));
            instructions.add(new TypeInsnNode(Opcodes.CHECKCAST, rty));
            if (unboxName != null)
                instructions.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, rty, unboxName, unboxDesc));
        }
        instructions.add(new InsnNode(retinst));
    }
View Full Code Here

Examples of org.objectweb.asm.tree.MethodInsnNode

        if (ty != null) {
            il.add(new TypeInsnNode(Opcodes.NEW, ty));
            il.add(new InsnNode(Opcodes.DUP));
        }
        il.add(new VarInsnNode(opc, ltmp));
        if (ty != null) il.add(new MethodInsnNode(Opcodes.INVOKESPECIAL, ty, "<init>", desc));
        il.add(new InsnNode(Opcodes.AASTORE));
        return at.getSize();
    }
View Full Code Here

Examples of org.objectweb.asm.tree.MethodInsnNode

      case 4:
        FieldInsnNode finsn = (FieldInsnNode) insn;
        visitFieldInsn(finsn.getOpcode(), finsn.owner, finsn.name, finsn.desc);
        break;
      case 5:
        MethodInsnNode minsn = (MethodInsnNode) insn;
        visitMethodInsn(minsn.getOpcode(), minsn.owner, minsn.name, minsn.desc);
        break;
      case 6:
        InvokeDynamicInsnNode idinsn = (InvokeDynamicInsnNode) insn;
        visitInvokeDynamicInsn(idinsn.name, idinsn.desc, idinsn.bsm, idinsn.bsmArgs);
        break;
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.