Examples of Cfg


Examples of edu.umd.cs.findbugs.ba.CFG

        if (method.getCode() == null) {
            return null;
        }

        CFG cfg = getCFG(analysisCache, descriptor);
        return new CompactLocationNumbering(cfg);
    }
View Full Code Here

Examples of edu.umd.cs.findbugs.ba.CFG

            throws CheckedAnalysisException {
        MethodGen methodGen = getMethodGen(analysisCache, descriptor);
        if (methodGen == null) {
            return null;
        }
        CFG cfg = getCFG(analysisCache, descriptor);

        ReverseDepthFirstSearch rdfs = getReverseDepthFirstSearch(analysisCache, descriptor);

        LiveLocalStoreAnalysis analysis = new LiveLocalStoreAnalysis(methodGen, rdfs, getDepthFirstSearch(analysisCache,
                descriptor));
View Full Code Here

Examples of edu.umd.cs.findbugs.ba.CFG

     * edu.umd.cs.findbugs.classfile.IAnalysisEngine#analyze(edu.umd.cs.findbugs
     * .classfile.IAnalysisCache, java.lang.Object)
     */
    @Override
    public BlockTypeDataflow analyze(IAnalysisCache analysisCache, MethodDescriptor descriptor) throws CheckedAnalysisException {
        CFG cfg = getCFG(analysisCache, descriptor);
        DepthFirstSearch dfs = getDepthFirstSearch(analysisCache, descriptor);
        BlockTypeAnalysis analysis = new BlockTypeAnalysis(dfs);
        BlockTypeDataflow dataflow = new BlockTypeDataflow(cfg, analysis);
        dataflow.execute();
        return dataflow;
View Full Code Here

Examples of edu.umd.cs.findbugs.ba.CFG

    public TypeDataflow analyze(IAnalysisCache analysisCache, MethodDescriptor descriptor) throws CheckedAnalysisException {
        MethodGen methodGen = getMethodGen(analysisCache, descriptor);
        if (methodGen == null) {
            throw new MethodUnprofitableException(descriptor);
        }
        CFG cfg = getCFG(analysisCache, descriptor);
        DepthFirstSearch dfs = getDepthFirstSearch(analysisCache, descriptor);
        ExceptionSetFactory exceptionSetFactory = getExceptionSetFactory(analysisCache, descriptor);
        Method method = getMethod(analysisCache, descriptor);

        TypeAnalysis typeAnalysis = new TypeAnalysis(method, methodGen, cfg, dfs, AnalysisContext.currentAnalysisContext()
View Full Code Here

Examples of edu.umd.cs.findbugs.ba.CFG

        if (methodGen == null) {
            throw new MethodUnprofitableException(descriptor);
        }
        ValueNumberDataflow vnaDataflow = getValueNumberDataflow(analysisCache, descriptor);
        DepthFirstSearch dfs = getDepthFirstSearch(analysisCache, descriptor);
        CFG cfg = getCFG(analysisCache, descriptor);

        LockAnalysis analysis = new LockAnalysis(methodGen, vnaDataflow, dfs);
        LockDataflow dataflow = new LockDataflow(cfg, analysis);
        dataflow.execute();
        return dataflow;
View Full Code Here

Examples of edu.umd.cs.findbugs.ba.CFG

     * edu.umd.cs.findbugs.classfile.IAnalysisEngine#analyze(edu.umd.cs.findbugs
     * .classfile.IAnalysisCache, java.lang.Object)
     */
    @Override
    public DepthFirstSearch analyze(IAnalysisCache analysisCache, MethodDescriptor descriptor) throws CheckedAnalysisException {
        CFG cfg = getCFG(analysisCache, descriptor);
        DepthFirstSearch dfs = new DepthFirstSearch(cfg);
        dfs.search();
        return dfs;
    }
View Full Code Here

Examples of edu.umd.cs.findbugs.ba.CFG

            // See if the store that saves the exception object
            // is alive or dead. We rely on the fact that javac
            // always (?) emits an ASTORE instruction to save
            // the caught exception.
            LiveLocalStoreDataflow dataflow = getClassContext().getLiveLocalStoreDataflow(getMethod());
            CFG cfg = getClassContext().getCFG(getMethod());
            Collection<BasicBlock> blockList = cfg.getBlocksContainingInstructionWithOffset(obj.getHandlerPC());
            for (BasicBlock block : blockList) {
                InstructionHandle first = block.getFirstInstruction();
                if (first != null && first.getPosition() == obj.getHandlerPC() && first.getInstruction() instanceof ASTORE) {
                    ASTORE astore = (ASTORE) first.getInstruction();
                    BitSet liveStoreSet = dataflow.getFactAtLocation(new Location(first, block));
View Full Code Here

Examples of edu.umd.cs.findbugs.ba.CFG

        }
    }

    private void analyzeMethod(ClassContext classContext, Method method) throws CFGBuilderException, ClassNotFoundException,
    DataflowAnalysisException {
        CFG cfg = classContext.getCFG(method);
        for (Iterator<Location> i = cfg.locationIterator(); i.hasNext();) {
            Location location = i.next();
            Instruction ins = location.getHandle().getInstruction();

            if (ins instanceof InvokeInstruction) {
                if (TARGET_METHOD != null
View Full Code Here

Examples of edu.umd.cs.findbugs.ba.CFG

        try {
            if (method.getCode() == null) {
                return;
            }

            CFG cfg = classContext.getCFG(method);

            Iterator<BasicBlock> bbi = cfg.blockIterator();
            while (bbi.hasNext()) {
                BasicBlock bb = bbi.next();

                int numOutgoing = cfg.getNumOutgoingEdges(bb);
                if (numOutgoing == 2) {
                    findIfElseDuplicates(cfg, method, bb);
                } else if (numOutgoing > 2) {
                    findSwitchDuplicates(cfg, method, bb);
                }
View Full Code Here

Examples of edu.umd.cs.findbugs.ba.CFG

    }

    private void analyzeMethod(ClassContext classContext, Method method) throws CFGBuilderException, DataflowAnalysisException {

        MethodGen methodGen = classContext.getMethodGen(method);
        CFG cfg = classContext.getCFG(method);
        LockDataflow dataflow = classContext.getLockDataflow(method);

        for (Iterator<Location> j = cfg.locationIterator(); j.hasNext();) {
            Location location = j.next();
            visitLocation(classContext, location, methodGen, dataflow);
        }
    }
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.