< prev index next >

src/java.base/share/classes/jdk/internal/org/objectweb/asm/commons/LocalVariablesSorter.java

Print this page

        

@@ -103,15 +103,10 @@
      * 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

@@ -226,15 +221,10 @@
         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);

@@ -326,11 +316,10 @@
             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

@@ -394,13 +383,10 @@
             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;
< prev index next >