mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 08:14:09 -08:00
Fix more bugs in devirtualization
This commit is contained in:
parent
2d2ef642a3
commit
7a2cd6ae4f
|
@ -262,6 +262,7 @@ public class ClassInference {
|
|||
for (int predecessor : assignmentGraph.incomingEdges(variable)) {
|
||||
int predecessorEntry = packNodeAndDegree(predecessor, degree);
|
||||
graphBuilder.addEdge(predecessorEntry, entry);
|
||||
graphBuilder.addEdge(entry, predecessorEntry);
|
||||
if (!visited[predecessorEntry]) {
|
||||
stack.push(predecessorEntry);
|
||||
}
|
||||
|
@ -270,10 +271,32 @@ public class ClassInference {
|
|||
for (int successor : itemGraph.outgoingEdges(variable)) {
|
||||
nextEntries.add(packNodeAndDegree(successor, degree - 1));
|
||||
}
|
||||
|
||||
for (int predecessor : arrayGraph.incomingEdges(variable)) {
|
||||
int predecessorEntry = packNodeAndDegree(predecessor, degree - 1);
|
||||
graphBuilder.addEdge(predecessorEntry, entry);
|
||||
if (!visited[predecessorEntry]) {
|
||||
stack.push(predecessorEntry);
|
||||
}
|
||||
}
|
||||
|
||||
for (int successor : assignmentGraph.outgoingEdges(variable)) {
|
||||
graphBuilder.addEdge(packNodeAndDegree(successor, degree), entry);
|
||||
}
|
||||
}
|
||||
|
||||
for (int successor : arrayGraph.outgoingEdges(variable)) {
|
||||
nextEntries.add(packNodeAndDegree(successor, degree + 1));
|
||||
if (degree <= MAX_DEGREE) {
|
||||
for (int successor : arrayGraph.outgoingEdges(variable)) {
|
||||
nextEntries.add(packNodeAndDegree(successor, degree + 1));
|
||||
}
|
||||
|
||||
for (int predecessor : itemGraph.incomingEdges(variable)) {
|
||||
int predecessorEntry = packNodeAndDegree(predecessor, degree + 1);
|
||||
graphBuilder.addEdge(predecessorEntry, entry);
|
||||
if (!visited[predecessorEntry]) {
|
||||
stack.push(predecessorEntry);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -321,7 +344,7 @@ public class ClassInference {
|
|||
|
||||
int node = nodeMapping[i];
|
||||
if (overflowTypesBackup[i]) {
|
||||
overflowTypes[i] = true;
|
||||
overflowTypes[node] = true;
|
||||
types[node] = null;
|
||||
} else if (typesBackup[i] != null && !overflowTypes[i]) {
|
||||
IntHashSet nodeTypes = getNodeTypes(node);
|
||||
|
|
Loading…
Reference in New Issue
Block a user