< prev index next >
src/java.base/share/classes/jdk/internal/org/objectweb/asm/commons/LocalVariablesSorter.java
Print this page
*** 103,117 ****
* Index of the next local variable to be created by {@link #newLocal}.
*/
protected int nextLocal;
/**
- * Indicates if at least one local variable has moved due to remapping.
- */
- private boolean changed;
-
- /**
* Creates a new {@link LocalVariablesSorter}. <i>Subclasses must not use
* this constructor</i>. Instead, they must use the
* {@link #LocalVariablesSorter(int, int, String, MethodVisitor)} version.
*
* @param access
--- 103,112 ----
*** 226,240 ****
if (type != Opcodes.F_NEW) { // uncompressed frame
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];
System.arraycopy(newLocals, 0, oldLocals, 0, oldLocals.length);
updateNewLocals(newLocals);
--- 221,230 ----
*** 326,336 ****
break;
}
int local = newLocalMapping(type);
setLocalType(local, type);
setFrameLocal(local, t);
- changed = true;
return local;
}
/**
* Notifies subclasses that a new stack map frame is being visited. The
--- 316,325 ----
*** 394,406 ****
setLocalType(value, type);
mapping[key] = value + 1;
} else {
value--;
}
- if (value != var) {
- changed = true;
- }
return value;
}
protected int newLocalMapping(final Type type) {
int local = nextLocal;
--- 383,392 ----
< prev index next >