Package org.objectweb.asm.tree.analysis

Examples of org.objectweb.asm.tree.analysis.Analyzer


        List methods = ca.methods;
        for (int i = 0; i < methods.size(); ++i) {
            MethodNode method = (MethodNode) methods.get(i);
            if (method.instructions.size() > 0) {
                Analyzer a = new Analyzer(new SimpleVerifier());
                try {
                    a.analyze(ca.name, method);
                    continue;
                } catch (Exception e) {
                    e.printStackTrace();
                }
                final Frame[] frames = a.getFrames();

                if (!failed) {
                    failed = true;
                    log("verifying of class " + clazz + " failed");
                }
View Full Code Here


    }

    public void process(@NotNull ParserClassNode classNode, @NotNull RuleMethod method) throws Exception {
        final RuleMethodInterpreter interpreter = new RuleMethodInterpreter(method);

        new Analyzer(interpreter) {
            @Override
            protected void newControlFlowEdge(int insn, int successor) {
                interpreter.newControlFlowEdge(insn, successor);
            }
View Full Code Here

            MethodNode method = (MethodNode) methods.get(i);
            SimpleVerifier verifier = new SimpleVerifier(Type.getObjectType(cn.name),
                    syperType,
                    interfaces,
                    false);
            Analyzer a = new Analyzer(verifier);
            if (loader != null) {
                verifier.setClassLoader(loader);
            }
            try {
                a.analyze(cn.name, method);
                if (!dump) {
                    continue;
                }
            } catch (Exception e) {
                e.printStackTrace(pw);
View Full Code Here

        List methods = cn.methods;
        for (int i = 0; i < methods.size(); ++i) {
            MethodNode method = (MethodNode) methods.get(i);
            if (method.instructions.size() > 0) {
                if (!analyze(cn, method)) {
                    Analyzer a = new Analyzer(new BasicVerifier());
                    try {
                        a.analyze(cn.name, method);
                    } catch (Exception ignored) {
                    }
                    final Frame[] frames = a.getFrames();

                    TraceMethodVisitor mv = new TraceMethodVisitor() {
                        public void visitMaxs(
                            final int maxStack,
                            final int maxLocals)
View Full Code Here

     * (in the control flow graph).
     */
    public static boolean analyze(final ClassNode c, final MethodNode m)
            throws Exception
    {
        Analyzer a = new Analyzer(new SourceInterpreter());
        Frame[] frames = a.analyze(c.name, m);

        // for each xLOAD instruction, we find the xSTORE instructions that can
        // produce the value loaded by this instruction, and we put them in
        // 'stores'
        Set stores = new HashSet();
View Full Code Here

                ? null
                : Type.getObjectType(cn.superName);
        List methods = cn.methods;
        for (int i = 0; i < methods.size(); ++i) {
            MethodNode method = (MethodNode) methods.get(i);
            Analyzer a = new Analyzer(new SimpleVerifier(Type.getObjectType(cn.name),
                    syperType,
                    false));
            try {
                a.analyze(cn.name, method);
                if (!dump) {
                    continue;
                }
            } catch (Exception e) {
                e.printStackTrace(pw);
            }
            Frame[] frames = a.getFrames();

            TraceMethodVisitor mv = new TraceMethodVisitor();

            pw.println(method.name + method.desc);
            for (int j = 0; j < method.instructions.size(); ++j) {
View Full Code Here

        cr.accept(new CheckClassAdapter(cn), ClassReader.SKIP_DEBUG);

        List methods = cn.methods;
        for (int i = 0; i < methods.size(); ++i) {
            MethodNode method = (MethodNode) methods.get(i);
            Analyzer a = new Analyzer(new SimpleVerifier(Type.getObjectType(cn.name),
                    Type.getObjectType(cn.superName),
                    false));
            try {
                a.analyze(cn.name, method);
                if (!dump) {
                    continue;
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
            Frame[] frames = a.getFrames();

            TraceMethodVisitor mv = new TraceMethodVisitor();

            pw.println(method.name + method.desc);
            for (int j = 0; j < method.instructions.size(); ++j) {
View Full Code Here

                ClassNode cn = new ClassNode();
                cr.accept(cn, ClassReader.SKIP_DEBUG);
                List methods = cn.methods;
                for (int k = 0; k < methods.size(); ++k) {
                    MethodNode method = (MethodNode) methods.get(k);
                    Analyzer a = new Analyzer(new SimpleVerifier());
                    try {
                        a.analyze(cn.name, method);
                    } catch (Throwable th) {
                        ++errors;
                    }
                }
            }
View Full Code Here

        List methods = ca.methods;
        for (int i = 0; i < methods.size(); ++i) {
            MethodNode method = (MethodNode) methods.get(i);
            if (method.instructions.size() > 0) {
                Analyzer a = new Analyzer(new SimpleVerifier());
                try {
                    a.analyze(ca.name, method);
                    continue;
                } catch (Exception e) {
                    e.printStackTrace();
                }
                final Frame[] frames = a.getFrames();

                if (!failed) {
                    failed = true;
                    log("verifying of class " + clazz + " failed");
                }
View Full Code Here

       
        List<?> methods = classNode.methods;
        for (int i = 0; i < methods.size(); ++i) {
            MethodNode method = (MethodNode)methods.get(i);
            if (method.instructions.size() > 0) {
                Analyzer a = new Analyzer(new BasicVerifier());
                try {
                    a.analyze(classNode.name, method);
                    continue;
                } catch (Exception e) {
                    System.out.println("Problems found checking: " + pathName + ".");
                    e.printStackTrace();                   
                }       
View Full Code Here

TOP

Related Classes of org.objectweb.asm.tree.analysis.Analyzer

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.