com.sun.tools.javac.comp.Infer.GraphSolver.InferenceGraph Java Examples
The following examples show how to use
com.sun.tools.javac.comp.Infer.GraphSolver.InferenceGraph.
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 jdk8u60 with GNU General Public License v2.0 | 6 votes |
/** * Pick the leaf that minimize cost */ @Override public Node pickNode(final InferenceGraph g) { treeCache.clear(); //graph changes at every step - cache must be cleared Pair<List<Node>, Integer> bestPath = noPath; for (Node n : g.nodes) { if (!Collections.disjoint(n.data, varsToSolve)) { Pair<List<Node>, Integer> path = computeTreeToLeafs(n); //discard all paths containing at least a node in the //closure computed above if (path.snd < bestPath.snd) { bestPath = path; } } } if (bestPath == noPath) { //no path leads there throw new NodeNotFoundException(g); } return bestPath.fst.head; }
Example #2
Source File: Infer.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
/** * Pick the leaf that minimize cost */ @Override public Node pickNode(final InferenceGraph g) { treeCache.clear(); //graph changes at every step - cache must be cleared Pair<List<Node>, Integer> bestPath = noPath; for (Node n : g.nodes) { if (!Collections.disjoint(n.data, varsToSolve)) { Pair<List<Node>, Integer> path = computeTreeToLeafs(n); //discard all paths containing at least a node in the //closure computed above if (path.snd < bestPath.snd) { bestPath = path; } } } if (bestPath == noPath) { //no path leads there throw new NodeNotFoundException(g); } return bestPath.fst.head; }
Example #3
Source File: Infer.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
/** * Pick the leaf that minimize cost */ @Override public Node pickNode(final InferenceGraph g) { treeCache.clear(); //graph changes at every step - cache must be cleared Pair<List<Node>, Integer> bestPath = noPath; for (Node n : g.nodes) { if (!Collections.disjoint(n.data, varsToSolve)) { Pair<List<Node>, Integer> path = computeTreeToLeafs(n); //discard all paths containing at least a node in the //closure computed above if (path.snd < bestPath.snd) { bestPath = path; } } } if (bestPath == noPath) { //no path leads there throw new NodeNotFoundException(g); } return bestPath.fst.head; }
Example #4
Source File: Infer.java From lua-for-android with BSD 3-Clause "New" or "Revised" License | 6 votes |
/** * Pick the leaf that minimize cost */ @Override public Node pickNode(final InferenceGraph g) { treeCache.clear(); //graph changes at every step - cache must be cleared Pair<List<Node>, Integer> bestPath = noPath; for (Node n : g.nodes) { if (!Collections.disjoint(n.data, varsToSolve)) { Pair<List<Node>, Integer> path = computeTreeToLeafs(n); //discard all paths containing at least a node in the //closure computed above if (path.snd < bestPath.snd) { bestPath = path; } } } if (bestPath == noPath) { //no path leads there throw new NodeNotFoundException(g); } return bestPath.fst.head; }
Example #5
Source File: Infer.java From hottub with GNU General Public License v2.0 | 6 votes |
/** * Pick the leaf that minimize cost */ @Override public Node pickNode(final InferenceGraph g) { treeCache.clear(); //graph changes at every step - cache must be cleared Pair<List<Node>, Integer> bestPath = noPath; for (Node n : g.nodes) { if (!Collections.disjoint(n.data, varsToSolve)) { Pair<List<Node>, Integer> path = computeTreeToLeafs(n); //discard all paths containing at least a node in the //closure computed above if (path.snd < bestPath.snd) { bestPath = path; } } } if (bestPath == noPath) { //no path leads there throw new NodeNotFoundException(g); } return bestPath.fst.head; }
Example #6
Source File: Infer.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
/** * Pick the leaf that minimize cost */ @Override public Node pickNode(final InferenceGraph g) { treeCache.clear(); //graph changes at every step - cache must be cleared Pair<List<Node>, Integer> bestPath = noPath; for (Node n : g.nodes) { if (!Collections.disjoint(n.data, varsToSolve)) { Pair<List<Node>, Integer> path = computeTreeToLeafs(n); //discard all paths containing at least a node in the //closure computed above if (path.snd < bestPath.snd) { bestPath = path; } } } if (bestPath == noPath) { //no path leads there throw new NodeNotFoundException(g); } return bestPath.fst.head; }
Example #7
Source File: Infer.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
/** * Pick the leaf that minimize cost */ @Override public Node pickNode(final InferenceGraph g) { treeCache.clear(); //graph changes at every step - cache must be cleared Pair<List<Node>, Integer> bestPath = noPath; for (Node n : g.nodes) { if (!Collections.disjoint(n.data, varsToSolve)) { Pair<List<Node>, Integer> path = computeTreeToLeafs(n); //discard all paths containing at least a node in the //closure computed above if (path.snd < bestPath.snd) { bestPath = path; } } } if (bestPath == noPath) { //no path leads there throw new NodeNotFoundException(g); } return bestPath.fst.head; }
Example #8
Source File: Infer.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
/** * Pick the leaf that minimize cost */ @Override public Node pickNode(final InferenceGraph g) { treeCache.clear(); //graph changes at every step - cache must be cleared Pair<List<Node>, Integer> bestPath = noPath; for (Node n : g.nodes) { if (!Collections.disjoint(n.data, varsToSolve)) { Pair<List<Node>, Integer> path = computeTreeToLeafs(n); //discard all paths containing at least a node in the //closure computed above if (path.snd < bestPath.snd) { bestPath = path; } } } if (bestPath == noPath) { //no path leads there throw new NodeNotFoundException(g); } return bestPath.fst.head; }
Example #9
Source File: Infer.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
/** * Pick the leaf that minimize cost */ @Override public Node pickNode(final InferenceGraph g) { treeCache.clear(); //graph changes at every step - cache must be cleared Pair<List<Node>, Integer> bestPath = noPath; for (Node n : g.nodes) { if (!Collections.disjoint(n.data, varsToSolve)) { Pair<List<Node>, Integer> path = computeTreeToLeafs(n); //discard all paths containing at least a node in the //closure computed above if (path.snd < bestPath.snd) { bestPath = path; } } } if (bestPath == noPath) { //no path leads there throw new NodeNotFoundException(g); } return bestPath.fst.head; }
Example #10
Source File: Infer.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
/** * 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 #11
Source File: Infer.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
public Node pickNode(InferenceGraph g) { if (g.nodes.isEmpty()) { //should not happen throw new NodeNotFoundException(g); }; return g.nodes.get(0); }
Example #12
Source File: Infer.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * 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 #13
Source File: Infer.java From hottub with GNU General Public License v2.0 | 5 votes |
public Node pickNode(InferenceGraph g) { if (g.nodes.isEmpty()) { //should not happen throw new NodeNotFoundException(g); }; return g.nodes.get(0); }
Example #14
Source File: Infer.java From hottub with GNU General Public License v2.0 | 5 votes |
/** * 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 #15
Source File: Infer.java From lua-for-android with BSD 3-Clause "New" or "Revised" License | 5 votes |
/** * 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 #16
Source File: Infer.java From lua-for-android with BSD 3-Clause "New" or "Revised" License | 5 votes |
public Node pickNode(InferenceGraph g) { if (g.nodes.isEmpty()) { //should not happen throw new NodeNotFoundException(g); } return g.nodes.get(0); }
Example #17
Source File: Infer.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
public Node pickNode(InferenceGraph g) { if (g.nodes.isEmpty()) { //should not happen throw new NodeNotFoundException(g); } return g.nodes.get(0); }
Example #18
Source File: Infer.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
public Node pickNode(InferenceGraph g) { if (g.nodes.isEmpty()) { //should not happen throw new NodeNotFoundException(g); }; return g.nodes.get(0); }
Example #19
Source File: Infer.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
/** * 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 #20
Source File: Infer.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
public Node pickNode(InferenceGraph g) { if (g.nodes.isEmpty()) { //should not happen throw new NodeNotFoundException(g); }; return g.nodes.get(0); }
Example #21
Source File: Infer.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
/** * 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 #22
Source File: Infer.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
public Node pickNode(InferenceGraph g) { if (g.nodes.isEmpty()) { //should not happen throw new NodeNotFoundException(g); }; return g.nodes.get(0); }
Example #23
Source File: Infer.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
/** * 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 #24
Source File: Infer.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
public Node pickNode(InferenceGraph g) { if (g.nodes.isEmpty()) { //should not happen throw new NodeNotFoundException(g); }; return g.nodes.get(0); }
Example #25
Source File: Infer.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
public Node pickNode(InferenceGraph g) { if (g.nodes.isEmpty()) { //should not happen throw new NodeNotFoundException(g); }; return g.nodes.get(0); }
Example #26
Source File: Infer.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
/** * 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 #27
Source File: Infer.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** * 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 #28
Source File: Infer.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
InferenceGraph(Map<Type, Set<Type>> optDeps) { initNodes(optDeps); }
Example #29
Source File: Infer.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
public NodeNotFoundException(InferenceGraph graph) { this.graph = graph; }
Example #30
Source File: Infer.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
InferenceGraph() { initNodes(); }