Skip to content

Commit

Permalink
Update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jpenilla committed Sep 27, 2024
1 parent 33812d0 commit 4ee50f5
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void generateMethod(final GeneratorAdapterFactory factory, final MethodCa
methodGenerator.visitLookupSwitchInsn(lookupSwitchEndLabel, lookupSwitchKeys, labels);
for (int i = 0; i < labels.length; i++) {
methodGenerator.mark(labels[i]);
// LocalVariableSorter inserts trailing int local for i == 0
// LocalVariableSorter will insert the trailing int local for this and all following visitFrame calls; adding it manually would cause duplicate locals in the frame
methodGenerator.visitFrame(Opcodes.F_NEW, 1, new Object[]{"java/lang/String"}, 1, new Object[]{"java/lang/String"});
// generate case
final List<String> matchingStrings = hashToField.get(lookupSwitchKeys[i]);
Expand Down Expand Up @@ -120,7 +120,6 @@ public void generateMethod(final GeneratorAdapterFactory factory, final MethodCa
methodGenerator.visitFrame(Opcodes.F_NEW, 1, new Object[]{"java/lang/String"}, 1, new Object[]{"java/lang/String"});
methodGenerator.loadArg(0); // default to the passed in value
methodGenerator.mark(tableSwitchEndLabel);
// LocalVariableSorter inserts trailing int local
methodGenerator.visitFrame(Opcodes.F_NEW, 1, new Object[]{"java/lang/String"}, 2, new Object[]{"java/lang/String", "java/lang/String"});
methodGenerator.invokeStatic(Type.getType(original.owner().descriptorString()), new Method(original.name(), original.descriptor().descriptorString()));
methodGenerator.returnValue();
Expand Down

0 comments on commit 4ee50f5

Please sign in to comment.