mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 16:14:10 -08:00
Revert some code
This commit is contained in:
parent
59408e40e5
commit
9adbb1ae93
|
@ -45,12 +45,12 @@ class DominatorTreeBuilder {
|
|||
bucket = new IntegerArray[graph.size()];
|
||||
}
|
||||
|
||||
public void build(int[] start) {
|
||||
public void build() {
|
||||
for (int i = 0; i < labels.length; ++i) {
|
||||
labels[i] = i;
|
||||
}
|
||||
Arrays.fill(ancestors, -1);
|
||||
dfs(start);
|
||||
dfs();
|
||||
for (int i = effectiveSize - 1; i >= 0; --i) {
|
||||
int w = vertices[i];
|
||||
if (parents[w] < 0) {
|
||||
|
@ -120,13 +120,15 @@ class DominatorTreeBuilder {
|
|||
return labels[v];
|
||||
}
|
||||
|
||||
private void dfs(int[] start) {
|
||||
private void dfs() {
|
||||
Arrays.fill(semidominators, -1);
|
||||
Arrays.fill(vertices, -1);
|
||||
IntegerStack stack = new IntegerStack(graph.size());
|
||||
for (int node : start) {
|
||||
stack.push(node);
|
||||
parents[node] = -1;
|
||||
for (int i = graph.size() - 1; i >= 0; --i) {
|
||||
if (graph.incomingEdgesCount(i) == 0) {
|
||||
stack.push(i);
|
||||
parents[i] = -1;
|
||||
}
|
||||
}
|
||||
int i = 0;
|
||||
while (!stack.isEmpty()) {
|
||||
|
|
|
@ -161,12 +161,8 @@ public final class GraphUtils {
|
|||
}
|
||||
|
||||
public static DominatorTree buildDominatorTree(Graph graph) {
|
||||
return buildDominatorTree(graph, 0);
|
||||
}
|
||||
|
||||
public static DominatorTree buildDominatorTree(Graph graph, int... start) {
|
||||
DominatorTreeBuilder builder = new DominatorTreeBuilder(graph);
|
||||
builder.build(start);
|
||||
builder.build();
|
||||
return new DefaultDominatorTree(builder.dominators, builder.vertices);
|
||||
}
|
||||
|
||||
|
|
|
@ -38,9 +38,9 @@ public class DJGraph {
|
|||
private int[] mergeRoot;
|
||||
private IntegerArray[] mergeClasses;
|
||||
|
||||
public DJGraph(Graph src, int top) {
|
||||
public DJGraph(Graph src) {
|
||||
this.cfg = new MutableDirectedGraph(src);
|
||||
domTree = GraphUtils.buildDominatorTree(src, top);
|
||||
domTree = GraphUtils.buildDominatorTree(src);
|
||||
buildGraph(src);
|
||||
buildLevels();
|
||||
dfs();
|
||||
|
|
|
@ -32,7 +32,7 @@ public class IrreducibleGraphConverter {
|
|||
|
||||
public void convertToReducible(Graph cfg, GraphSplittingBackend backend) {
|
||||
this.backend = backend;
|
||||
handleLoops(new DJGraph(cfg, 0));
|
||||
handleLoops(new DJGraph(cfg));
|
||||
this.backend = null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user