mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 16:14:10 -08:00
Fixes bug in GVN
This commit is contained in:
parent
520008913e
commit
9fe66c4f2e
|
@ -37,6 +37,9 @@ public class PreOptimizingClassHolderSource implements ClassHolderSource {
|
|||
ClassHolder cls = cache.get(name);
|
||||
if (cls == null) {
|
||||
cls = innerClassSource.get(name);
|
||||
if (cls == null) {
|
||||
return null;
|
||||
}
|
||||
for (MethodHolder method : cls.getMethods()) {
|
||||
new GlobalValueNumbering().optimize(method, method.getProgram());
|
||||
new UnusedVariableElimination().optimize(method, method.getProgram());
|
||||
|
|
|
@ -296,7 +296,7 @@ public class InstructionStringifier implements InstructionReader {
|
|||
|
||||
@Override
|
||||
public void cloneArray(VariableReader receiver, VariableReader array) {
|
||||
sb.append("@").append(receiver.getIndex()).append("@").append(array.getIndex()).append(".clone()");
|
||||
sb.append("@").append(receiver.getIndex()).append(" := @").append(array.getIndex()).append(".clone()");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -360,6 +360,8 @@ public class GlobalValueNumbering implements MethodOptimization {
|
|||
|
||||
@Override
|
||||
public void visit(CloneArrayInstruction insn) {
|
||||
int a = map[insn.getArray().getIndex()];
|
||||
insn.setArray(program.variableAt(a));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue
Block a user