mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 08:14:09 -08:00
Bug fixes in optimizer
This commit is contained in:
parent
7058a195b7
commit
4a62b58f82
|
@ -343,7 +343,7 @@ public final class GraphUtils {
|
||||||
stack[top++] = node;
|
stack[top++] = node;
|
||||||
for (int successor : graph.outgoingEdges(node)) {
|
for (int successor : graph.outgoingEdges(node)) {
|
||||||
if (state[successor] == 0) {
|
if (state[successor] == 0) {
|
||||||
stack[top++] = node;
|
stack[top++] = successor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -65,6 +65,9 @@ public class AliasAnalysis {
|
||||||
private DfgBuildVisitor prepare(Program program, MethodDescriptor methodDescriptor) {
|
private DfgBuildVisitor prepare(Program program, MethodDescriptor methodDescriptor) {
|
||||||
DfgBuildVisitor visitor = new DfgBuildVisitor(program.variableCount());
|
DfgBuildVisitor visitor = new DfgBuildVisitor(program.variableCount());
|
||||||
|
|
||||||
|
visitor.queue.addLast(0);
|
||||||
|
visitor.queue.addLast(0);
|
||||||
|
|
||||||
for (int i = 1; i <= methodDescriptor.parameterCount(); ++i) {
|
for (int i = 1; i <= methodDescriptor.parameterCount(); ++i) {
|
||||||
if (methodDescriptor.parameterType(i - 1) instanceof ValueType.Object) {
|
if (methodDescriptor.parameterType(i - 1) instanceof ValueType.Object) {
|
||||||
visitor.queue.addLast(i);
|
visitor.queue.addLast(i);
|
||||||
|
|
|
@ -502,7 +502,7 @@ public class Inlining {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ProgramReader getProgram(MethodReference method) {
|
public ProgramReader getProgram(MethodReference method) {
|
||||||
ClassReader cls = dependencyInfo.getClassSource().get(method.getClassName());
|
ClassReader cls = classes.get(method.getClassName());
|
||||||
if (cls == null) {
|
if (cls == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user