Commit 4d61dd15 authored by Eric Bruneton's avatar Eric Bruneton

Revert bug fix.

parent 648c512e
......@@ -65,6 +65,8 @@ public class LocalVariablesSorter extends MethodVisitor {
/** Index of the next local variable to be created by {@link #newLocal}. */
protected int nextLocal;
private boolean changed;
/**
* Constructs a new {@link LocalVariablesSorter}. <i>Subclasses must not use this constructor</i>.
* Instead, they must use the {@link #LocalVariablesSorter(int, int, String, MethodVisitor)}
......@@ -186,6 +188,10 @@ public class LocalVariablesSorter extends MethodVisitor {
throw new IllegalStateException(
"ClassReader.accept() should be called with EXPAND_FRAMES flag");
}
if (!changed) { // optimization for the case where mapping = identity
mv.visitFrame(type, nLocal, local, nStack, stack);
return;
}
// creates a copy of newLocals
Object[] oldLocals = new Object[newLocals.length];
......@@ -281,6 +287,7 @@ public class LocalVariablesSorter extends MethodVisitor {
int local = newLocalMapping(type);
setLocalType(local, type);
setFrameLocal(local, t);
changed = true;
return local;
}
......@@ -338,6 +345,9 @@ public class LocalVariablesSorter extends MethodVisitor {
} else {
value--;
}
if (value != var) {
changed = true;
}
return value;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment