Bug fixes in optimizer

This commit is contained in:
Alexey Andreev 2021-04-02 19:36:30 +03:00
parent 7058a195b7
commit 4a62b58f82
3 changed files with 5 additions and 2 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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;
} }