Examples of LiveVariablesProblem


Examples of org.jruby.compiler.ir.dataflow.analyses.LiveVariablesProblem

    {
        if (!(s instanceof IRMethod))
            return;

        CFG c = ((IRMethod)s).getCFG();
        LiveVariablesProblem lvp = new LiveVariablesProblem();
      String lvpName = lvp.getName();
        lvp.setup(c);
        lvp.compute_MOP_Solution();
        c.setDataFlowSolution(lvp.getName(), lvp);
//        System.out.println("LVP for " + s + " is: " + lvp);
        for (IRClosure x: ((IRMethod)s).getClosures()) {
        CFG xc = x.getCFG();
        if (xc != null)
          lvp = (LiveVariablesProblem)xc.getDataFlowSolution(lvpName);
View Full Code Here

Examples of org.jruby.compiler.ir.dataflow.analyses.LiveVariablesProblem

    public void run(IRScope s) {
        if (!(s instanceof IRMethod)) return;

        CFG c = ((IRMethod) s).getCFG();
        LiveVariablesProblem lvp = (LiveVariablesProblem) c.getDataFlowSolution(DataFlowConstants.LVP_NAME);
       
        if (lvp == null) {
            lvp = new LiveVariablesProblem();
            lvp.setup(c);
            lvp.compute_MOP_Solution();
            c.setDataFlowSolution(lvp.getName(), lvp);
        }
       
        lvp.markDeadInstructions();
    }
View Full Code Here

Examples of org.jruby.ir.dataflow.analyses.LiveVariablesProblem

    public Object previouslyRun(IRScope scope) {
        return scope.getDataFlowSolution(LiveVariablesProblem.NAME);
    }

    public Object execute(IRScope scope, Object... data) {
        LiveVariablesProblem lvp = new LiveVariablesProblem(scope);
        lvp.compute_MOP_Solution();
       
        scope.setDataFlowSolution(LiveVariablesProblem.NAME, lvp);
       
        return lvp;
    }
View Full Code Here

Examples of org.jruby.ir.dataflow.analyses.LiveVariablesProblem

        // }

        // Make sure flags are computed
        scope.computeScopeFlags();

        LiveVariablesProblem lvp = new LiveVariablesProblem(scope);

        if (scope instanceof IRClosure) {
            // Go conservative! Normally, closure scopes are analyzed
            // in the context of their outermost method scopes where we
            // have better knowledge of aliveness in that global context.
            //
            // But, if we are analyzing closures standalone, we have to
            // conservatively assume that any dirtied variables that
            // belong to an outer scope are live on exit.
            Set<LocalVariable> nlVars = new HashSet<LocalVariable>();
            collectNonLocalDirtyVars((IRClosure)scope, nlVars, scope.getFlags().contains(IRFlags.DYNSCOPE_ELIMINATED) ? -1 : 0);

            // Init DF vars from this set
            for (Variable v: nlVars) {
                lvp.addDFVar(v);
            }
            lvp.setVarsLiveOnScopeExit(nlVars);
        }

        lvp.compute_MOP_Solution();
        scope.setDataFlowSolution(LiveVariablesProblem.NAME, lvp);

        return lvp;
    }
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.