Java Code Examples for com.sun.tools.javac.comp.Infer.GraphSolver.InferenceGraph#deleteNode()

The following examples show how to use com.sun.tools.javac.comp.Infer.GraphSolver.InferenceGraph#deleteNode() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Infer.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Solve variables in a given inference context. The amount of variables
 * to be solved, and the way in which the underlying acyclic graph is explored
 * depends on the selected solver strategy.
 */
void solve(GraphStrategy sstrategy) {
    checkWithinBounds(inferenceContext, warn); //initial propagation of bounds
    InferenceGraph inferenceGraph = new InferenceGraph(stuckDeps);
    while (!sstrategy.done()) {
        InferenceGraph.Node nodeToSolve = sstrategy.pickNode(inferenceGraph);
        List<Type> varsToSolve = List.from(nodeToSolve.data);
        List<Type> saved_undet = inferenceContext.save();
        try {
            //repeat until all variables are solved
            outer: while (Type.containsAny(inferenceContext.restvars(), varsToSolve)) {
                //for each inference phase
                for (GraphInferenceSteps step : GraphInferenceSteps.values()) {
                    if (inferenceContext.solveBasic(varsToSolve, step.steps)) {
                        checkWithinBounds(inferenceContext, warn);
                        continue outer;
                    }
                }
                //no progress
                throw inferenceException.setMessage();
            }
        }
        catch (InferenceException ex) {
            //did we fail because of interdependent ivars?
            inferenceContext.rollback(saved_undet);
            instantiateAsUninferredVars(varsToSolve, inferenceContext);
            checkWithinBounds(inferenceContext, warn);
        }
        inferenceGraph.deleteNode(nodeToSolve);
    }
}
 
Example 2
Source File: Infer.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Solve variables in a given inference context. The amount of variables
 * to be solved, and the way in which the underlying acyclic graph is explored
 * depends on the selected solver strategy.
 */
void solve(GraphStrategy sstrategy) {
    checkWithinBounds(inferenceContext, warn); //initial propagation of bounds
    InferenceGraph inferenceGraph = new InferenceGraph(stuckDeps);
    while (!sstrategy.done()) {
        InferenceGraph.Node nodeToSolve = sstrategy.pickNode(inferenceGraph);
        List<Type> varsToSolve = List.from(nodeToSolve.data);
        List<Type> saved_undet = inferenceContext.save();
        try {
            //repeat until all variables are solved
            outer: while (Type.containsAny(inferenceContext.restvars(), varsToSolve)) {
                //for each inference phase
                for (GraphInferenceSteps step : GraphInferenceSteps.values()) {
                    if (inferenceContext.solveBasic(varsToSolve, step.steps)) {
                        checkWithinBounds(inferenceContext, warn);
                        continue outer;
                    }
                }
                //no progress
                throw inferenceException.setMessage();
            }
        }
        catch (InferenceException ex) {
            //did we fail because of interdependent ivars?
            inferenceContext.rollback(saved_undet);
            instantiateAsUninferredVars(varsToSolve, inferenceContext);
            checkWithinBounds(inferenceContext, warn);
        }
        inferenceGraph.deleteNode(nodeToSolve);
    }
}
 
Example 3
Source File: Infer.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Solve variables in a given inference context. The amount of variables
 * to be solved, and the way in which the underlying acyclic graph is explored
 * depends on the selected solver strategy.
 */
void solve(GraphStrategy sstrategy) {
    checkWithinBounds(inferenceContext, warn); //initial propagation of bounds
    InferenceGraph inferenceGraph = new InferenceGraph(stuckDeps);
    while (!sstrategy.done()) {
        InferenceGraph.Node nodeToSolve = sstrategy.pickNode(inferenceGraph);
        List<Type> varsToSolve = List.from(nodeToSolve.data);
        List<Type> saved_undet = inferenceContext.save();
        try {
            //repeat until all variables are solved
            outer: while (Type.containsAny(inferenceContext.restvars(), varsToSolve)) {
                //for each inference phase
                for (GraphInferenceSteps step : GraphInferenceSteps.values()) {
                    if (inferenceContext.solveBasic(varsToSolve, step.steps)) {
                        checkWithinBounds(inferenceContext, warn);
                        continue outer;
                    }
                }
                //no progress
                throw inferenceException.setMessage();
            }
        }
        catch (InferenceException ex) {
            //did we fail because of interdependent ivars?
            inferenceContext.rollback(saved_undet);
            instantiateAsUninferredVars(varsToSolve, inferenceContext);
            checkWithinBounds(inferenceContext, warn);
        }
        inferenceGraph.deleteNode(nodeToSolve);
    }
}
 
Example 4
Source File: Infer.java    From lua-for-android with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * Solve variables in a given inference context. The amount of variables
 * to be solved, and the way in which the underlying acyclic graph is explored
 * depends on the selected solver strategy.
 */
void solve(GraphStrategy sstrategy) {
    doIncorporation(inferenceContext, warn); //initial propagation of bounds
    InferenceGraph inferenceGraph = new InferenceGraph();
    while (!sstrategy.done()) {
        if (dependenciesFolder != null) {
            //add this graph to the pending queue
            pendingGraphs = pendingGraphs.prepend(inferenceGraph.toDot());
        }
        InferenceGraph.Node nodeToSolve = sstrategy.pickNode(inferenceGraph);
        List<Type> varsToSolve = List.from(nodeToSolve.data);
        List<Type> saved_undet = inferenceContext.save();
        try {
            //repeat until all variables are solved
            outer: while (Type.containsAny(inferenceContext.restvars(), varsToSolve)) {
                //for each inference phase
                for (GraphInferenceSteps step : GraphInferenceSteps.values()) {
                    if (inferenceContext.solveBasic(varsToSolve, step.steps).nonEmpty()) {
                        doIncorporation(inferenceContext, warn);
                        continue outer;
                    }
                }
                //no progress
                throw inferenceException.setMessage();
            }
        }
        catch (InferenceException ex) {
            //did we fail because of interdependent ivars?
            inferenceContext.rollback(saved_undet);
            instantiateAsUninferredVars(varsToSolve, inferenceContext);
            doIncorporation(inferenceContext, warn);
        }
        inferenceGraph.deleteNode(nodeToSolve);
    }
}
 
Example 5
Source File: Infer.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Solve variables in a given inference context. The amount of variables
 * to be solved, and the way in which the underlying acyclic graph is explored
 * depends on the selected solver strategy.
 */
void solve(GraphStrategy sstrategy) {
    checkWithinBounds(inferenceContext, warn); //initial propagation of bounds
    InferenceGraph inferenceGraph = new InferenceGraph(stuckDeps);
    while (!sstrategy.done()) {
        InferenceGraph.Node nodeToSolve = sstrategy.pickNode(inferenceGraph);
        List<Type> varsToSolve = List.from(nodeToSolve.data);
        List<Type> saved_undet = inferenceContext.save();
        try {
            //repeat until all variables are solved
            outer: while (Type.containsAny(inferenceContext.restvars(), varsToSolve)) {
                //for each inference phase
                for (GraphInferenceSteps step : GraphInferenceSteps.values()) {
                    if (inferenceContext.solveBasic(varsToSolve, step.steps)) {
                        checkWithinBounds(inferenceContext, warn);
                        continue outer;
                    }
                }
                //no progress
                throw inferenceException.setMessage();
            }
        }
        catch (InferenceException ex) {
            //did we fail because of interdependent ivars?
            inferenceContext.rollback(saved_undet);
            instantiateAsUninferredVars(varsToSolve, inferenceContext);
            checkWithinBounds(inferenceContext, warn);
        }
        inferenceGraph.deleteNode(nodeToSolve);
    }
}
 
Example 6
Source File: Infer.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Solve variables in a given inference context. The amount of variables
 * to be solved, and the way in which the underlying acyclic graph is explored
 * depends on the selected solver strategy.
 */
void solve(GraphStrategy sstrategy) {
    doIncorporation(inferenceContext, warn); //initial propagation of bounds
    InferenceGraph inferenceGraph = new InferenceGraph();
    while (!sstrategy.done()) {
        if (dependenciesFolder != null) {
            //add this graph to the pending queue
            pendingGraphs = pendingGraphs.prepend(inferenceGraph.toDot());
        }
        InferenceGraph.Node nodeToSolve = sstrategy.pickNode(inferenceGraph);
        List<Type> varsToSolve = List.from(nodeToSolve.data);
        List<Type> saved_undet = inferenceContext.save();
        try {
            //repeat until all variables are solved
            outer: while (Type.containsAny(inferenceContext.restvars(), varsToSolve)) {
                //for each inference phase
                for (GraphInferenceSteps step : GraphInferenceSteps.values()) {
                    if (inferenceContext.solveBasic(varsToSolve, step.steps).nonEmpty()) {
                        doIncorporation(inferenceContext, warn);
                        continue outer;
                    }
                }
                //no progress
                throw inferenceException.setMessage();
            }
        }
        catch (InferenceException ex) {
            //did we fail because of interdependent ivars?
            inferenceContext.rollback(saved_undet);
            instantiateAsUninferredVars(varsToSolve, inferenceContext);
            doIncorporation(inferenceContext, warn);
        }
        inferenceGraph.deleteNode(nodeToSolve);
    }
}
 
Example 7
Source File: Infer.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Solve variables in a given inference context. The amount of variables
 * to be solved, and the way in which the underlying acyclic graph is explored
 * depends on the selected solver strategy.
 */
void solve(GraphStrategy sstrategy) {
    checkWithinBounds(inferenceContext, warn); //initial propagation of bounds
    InferenceGraph inferenceGraph = new InferenceGraph(stuckDeps);
    while (!sstrategy.done()) {
        InferenceGraph.Node nodeToSolve = sstrategy.pickNode(inferenceGraph);
        List<Type> varsToSolve = List.from(nodeToSolve.data);
        List<Type> saved_undet = inferenceContext.save();
        try {
            //repeat until all variables are solved
            outer: while (Type.containsAny(inferenceContext.restvars(), varsToSolve)) {
                //for each inference phase
                for (GraphInferenceSteps step : GraphInferenceSteps.values()) {
                    if (inferenceContext.solveBasic(varsToSolve, step.steps)) {
                        checkWithinBounds(inferenceContext, warn);
                        continue outer;
                    }
                }
                //no progress
                throw inferenceException.setMessage();
            }
        }
        catch (InferenceException ex) {
            //did we fail because of interdependent ivars?
            inferenceContext.rollback(saved_undet);
            instantiateAsUninferredVars(varsToSolve, inferenceContext);
            checkWithinBounds(inferenceContext, warn);
        }
        inferenceGraph.deleteNode(nodeToSolve);
    }
}
 
Example 8
Source File: Infer.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Solve variables in a given inference context. The amount of variables
 * to be solved, and the way in which the underlying acyclic graph is explored
 * depends on the selected solver strategy.
 */
void solve(GraphStrategy sstrategy) {
    checkWithinBounds(inferenceContext, warn); //initial propagation of bounds
    InferenceGraph inferenceGraph = new InferenceGraph(stuckDeps);
    while (!sstrategy.done()) {
        InferenceGraph.Node nodeToSolve = sstrategy.pickNode(inferenceGraph);
        List<Type> varsToSolve = List.from(nodeToSolve.data);
        List<Type> saved_undet = inferenceContext.save();
        try {
            //repeat until all variables are solved
            outer: while (Type.containsAny(inferenceContext.restvars(), varsToSolve)) {
                //for each inference phase
                for (GraphInferenceSteps step : GraphInferenceSteps.values()) {
                    if (inferenceContext.solveBasic(varsToSolve, step.steps)) {
                        checkWithinBounds(inferenceContext, warn);
                        continue outer;
                    }
                }
                //no progress
                throw inferenceException.setMessage();
            }
        }
        catch (InferenceException ex) {
            //did we fail because of interdependent ivars?
            inferenceContext.rollback(saved_undet);
            instantiateAsUninferredVars(varsToSolve, inferenceContext);
            checkWithinBounds(inferenceContext, warn);
        }
        inferenceGraph.deleteNode(nodeToSolve);
    }
}
 
Example 9
Source File: Infer.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Solve variables in a given inference context. The amount of variables
 * to be solved, and the way in which the underlying acyclic graph is explored
 * depends on the selected solver strategy.
 */
void solve(GraphStrategy sstrategy) {
    checkWithinBounds(inferenceContext, warn); //initial propagation of bounds
    InferenceGraph inferenceGraph = new InferenceGraph(stuckDeps);
    while (!sstrategy.done()) {
        InferenceGraph.Node nodeToSolve = sstrategy.pickNode(inferenceGraph);
        List<Type> varsToSolve = List.from(nodeToSolve.data);
        List<Type> saved_undet = inferenceContext.save();
        try {
            //repeat until all variables are solved
            outer: while (Type.containsAny(inferenceContext.restvars(), varsToSolve)) {
                //for each inference phase
                for (GraphInferenceSteps step : GraphInferenceSteps.values()) {
                    if (inferenceContext.solveBasic(varsToSolve, step.steps)) {
                        checkWithinBounds(inferenceContext, warn);
                        continue outer;
                    }
                }
                //no progress
                throw inferenceException.setMessage();
            }
        }
        catch (InferenceException ex) {
            //did we fail because of interdependent ivars?
            inferenceContext.rollback(saved_undet);
            instantiateAsUninferredVars(varsToSolve, inferenceContext);
            checkWithinBounds(inferenceContext, warn);
        }
        inferenceGraph.deleteNode(nodeToSolve);
    }
}