Package org.objectweb.asm.tree

Examples of org.objectweb.asm.tree.MethodInsnNode


      // If ALOAD and previous instruction was a map(Object, Object) or mutator
      if (opcode == Opcodes.ALOAD) {
        if (!instructions.isEmpty()) {
          AbstractInsnNode previous = instructions.get(instructions.size() - 1);
          if (isMethodInvocation(previous)) {
            MethodInsnNode mn = (MethodInsnNode) previous;
            if (isMapBothMethod(mn) || !isAccessor(mn))
              instructions.add(new InsnNode(opcode));
          }
        }
      }
View Full Code Here


          && (name.equals(SOURCE_FIELD) || name.equals(DEST_FIELD));

      // If not special and not source method invocation and owner is not a primitive wrapper
      if (opcode != Opcodes.INVOKESPECIAL && !isSourceMethod
          && !Primitives.isPrimitiveWrapperInternalName(owner))
        instructions.add(new MethodInsnNode(opcode, owner, name, desc, itf));
    }
View Full Code Here

          else if (subjectType == 2) {
            setLastMutatorOwner(Type.getType(fn.desc));
            recordDestinationField(ownerType, fieldFor(ownerType, fn));
          }
        } else if (isMethodInvocation(ins)) {
          MethodInsnNode mn = (MethodInsnNode) ins;

          if (isMapMethod(mn) || isSkipMethod(mn)) {
            lastMutatorOwner = destClassInternalName;
            if (MAP_DEST_METHOD_DESC.equals(mn.desc)) {
              mapType = 1;
View Full Code Here

    static String fiberArg = D_FIBER + ')';
    void genCall(MethodVisitor mv) {
        mv.visitLabel(callLabel.getLabel());
        loadVar(mv, TOBJECT, methodWeaver.getFiberVar());
        mv.visitMethodInsn(INVOKEVIRTUAL, FIBER_CLASS, "down", "()" + D_FIBER);
        MethodInsnNode mi = getMethodInsn();
        if (mi.desc.indexOf(fiberArg) == -1) {
            // Don't add another fiberarg if it already has one. It'll already
            // have one if we have copied jsr instructions and modified the
            // same instruction node earlier.
            mi.desc = mi.desc.replace(")", fiberArg);
        }
        mi.accept(mv);
    }
View Full Code Here

        }
        releaseVar(stateVar, 1);
    }

    private String getReceiverTypename() {
        MethodInsnNode min = getMethodInsn();
        return min.owner;
    }
View Full Code Here

        // method call sites. If the class is already woven, we don't need this
        // functionality.
        if (!classFlow.isWoven) {
            int methodStatus = detector.getPausableStatus(owner, name, desc);
            if (methodStatus == Detector.PAUSABLE_METHOD_FOUND) {
                MethodInsnNode min = (MethodInsnNode)instructions.get(instructions.size()-1);
                pausableMethods.add(min);
            }
        }
    }
View Full Code Here

                    case INVOKEVIRTUAL:
                    case INVOKESPECIAL:
                    case INVOKESTATIC:
                    case INVOKEINTERFACE:
                        // pop args, push return value
                        MethodInsnNode min = ((MethodInsnNode) ain);
                        String desc = min.desc;
                        if (flow.isPausableMethodInsn(min) && frame.numMonitorsActive > 0) {
                            throw new KilimException("Error: Can not call pausable nethods from within a synchronized block\n" +
                                    "Caller: " + this.flow.classFlow.name.replace('/', '.') + "." + this.flow.name + this.flow.desc +
                                    "\nCallee: " + ((MethodInsnNode)ain).name);
View Full Code Here


    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

        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

            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

TOP

Related Classes of org.objectweb.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.