Package org.objectweb.asm.tree

Examples of org.objectweb.asm.tree.MethodInsnNode


            case INVOKEVIRTUAL:
            case INVOKESTATIC:
            case INVOKESPECIAL:
            case INVOKEINTERFACE:
                MethodInsnNode calledMethod = (MethodInsnNode) node.getInstruction();
                Checks.ensure(!isPrivate(calledMethod.owner, calledMethod.name, calledMethod.desc),
                        "Rule method '%s' contains an illegal call to private method '%s'.\nMark '%s' protected or " +
                                "package-private if you want to prevent public access!",
                        method.name, calledMethod.name, calledMethod.name);
                break;
View Full Code Here


    public void process(@NotNull ParserClassNode classNode, @NotNull RuleMethod method) throws Exception {
        // replace all method code with a simple call to the super method
        method.instructions.clear();
        method.instructions.add(new VarInsnNode(ALOAD, 0));
        method.instructions.add(createArgumentLoaders(method.desc));
        method.instructions.add(new MethodInsnNode(INVOKESPECIAL,
                classNode.getParentType().getInternalName(), method.name, method.desc));
        method.instructions.add(new InsnNode(ARETURN));
    }
View Full Code Here

        return type.isAssignableFrom(getClassForInternalName(classInternalName));
    }

    public static boolean isBooleanValueOfZ(@NotNull AbstractInsnNode insn) {
        if (insn.getOpcode() != Opcodes.INVOKESTATIC) return false;
        MethodInsnNode mi = (MethodInsnNode) insn;
        return isBooleanValueOfZ(mi.owner, mi.name, mi.desc);
    }
View Full Code Here

                "(Z)Ljava/lang/Boolean;".equals(methodDesc);
    }

    public static boolean isActionRoot(@NotNull AbstractInsnNode insn) {
        if (insn.getOpcode() != Opcodes.INVOKESTATIC) return false;
        MethodInsnNode mi = (MethodInsnNode) insn;
        return isActionRoot(mi.owner, mi.name);
    }
View Full Code Here

        return "ACTION".equals(methodName) && isAssignableTo(methodOwner, BaseParser.class);
    }

    public static boolean isVarRoot(@NotNull AbstractInsnNode insn) {
        if (insn.getOpcode() != Opcodes.INVOKESPECIAL) return false;
        MethodInsnNode mi = (MethodInsnNode) insn;
        return isVarRoot(mi.owner, mi.name, mi.desc);
    }
View Full Code Here

                isAssignableTo(methodOwner, Var.class);
    }

    public static boolean isCallOnContextAware(@NotNull AbstractInsnNode insn) {
        if (insn.getOpcode() != Opcodes.INVOKEVIRTUAL && insn.getOpcode() != Opcodes.INVOKEINTERFACE) return false;
        MethodInsnNode mi = (MethodInsnNode) insn;
        return isAssignableTo(mi.owner, ContextAware.class);
    }
View Full Code Here

        "f", "I"));
  }

  @Test
  public void testMethodInsn() {
    testInstructionBetweenFrames(new MethodInsnNode(Opcodes.INVOKEVIRTUAL,
        "Foo", "run", "()V"));
  }
View Full Code Here

        switch (insn.getOpcode()) {
        case INVOKEVIRTUAL:
        case INVOKESPECIAL:
        case INVOKESTATIC:
        case INVOKEINTERFACE: {
            final MethodInsnNode invoke = (MethodInsnNode) insn;
            return new Invoke(Type.getReturnType(invoke.desc), values);
        }
        case INVOKEDYNAMIC: {
            final InvokeDynamicInsnNode invoke = (InvokeDynamicInsnNode) insn;
            return new Invoke(Type.getReturnType(invoke.desc), values);
View Full Code Here

       
        break;
      }
     
      case INVOKE: {
        final MethodInsnNode m = (MethodInsnNode) instruction.getInstruction();
       
        final int nargs = Type.getArgumentTypes(m.desc).length;
       
        final ValueRef[] args = pop(stack, opcode == Opcodes.INVOKESTATIC ? nargs : nargs + 1);
       
View Full Code Here

        assertEquals("J", ((TypeInsnNode) it.next()).desc);
       
        MultiANewArrayInsnNode n3 = (MultiANewArrayInsnNode) it.next();
        assertEquals("[[LB1;", n3.desc);
       
        MethodInsnNode n4 = (MethodInsnNode) it.next();
        assertEquals("D1", n4.owner);
        assertEquals("([[LB1;LC1;LD1;)LC1;", n4.desc);
       
        FrameNode fn0 = (FrameNode) it.next();
        assertEquals(Collections.EMPTY_LIST, fn0.local);
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.