Skip to content

Commit

Permalink
Remove an unused method
Browse files Browse the repository at this point in the history
  • Loading branch information
IotaBread committed Sep 29, 2024
1 parent 56b282b commit b181e0e
Showing 1 changed file with 0 additions and 43 deletions.
43 changes: 0 additions & 43 deletions src/main/java/org/quiltmc/enigma_plugin/util/AsmUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -272,47 +272,4 @@ public static FieldInsnNode searchStaticFieldReferenceInStack(InsnList insns, Ab

return null;
}

public static void printFrames(MethodNode method, Frame<SourceValue>[] frames, PrintWriter printWriter) {
Textifier textifier = new Textifier();
TraceMethodVisitor traceMethodVisitor = new TraceMethodVisitor(textifier);

printWriter.println(method.name + method.desc);
for (int i = 0; i < method.instructions.size(); ++i) {
StringBuilder stringBuilder = new StringBuilder();
Frame<SourceValue> frame = frames[i];
if (frame == null) {
stringBuilder.append('?');
} else {
for (int j = 0; j < frame.getLocals(); ++j) {
stringBuilder.append('[')
.append(frame.getLocal(j).insns.stream().map(insn -> method.instructions.indexOf(insn) + 100000)
.map(k -> String.valueOf(k).substring(1))
.reduce((a, b) -> a + ", " + b).orElse("?"))
.append("] ");
}
stringBuilder.append(" : ");
for (int j = 0; j < frame.getStackSize(); ++j) {
stringBuilder.append('[')
.append(frame.getStack(j).insns.stream().map(insn -> method.instructions.indexOf(insn) + 100000)
.map(k -> String.valueOf(k).substring(1))
.reduce((a, b) -> a + ", " + b).orElse("?"))
.append("] ");
}
}
while (stringBuilder.length() < method.maxStack + method.maxLocals + 1) {
stringBuilder.append(' ');
}
printWriter.print(Integer.toString(i + 100000).substring(1));

method.instructions.get(i).accept(traceMethodVisitor);
printWriter.print(
" " + stringBuilder + " : " + textifier.text.get(textifier.text.size() - 1));
}
for (TryCatchBlockNode tryCatchBlock : method.tryCatchBlocks) {
tryCatchBlock.accept(traceMethodVisitor);
printWriter.print(" " + textifier.text.get(textifier.text.size() - 1));
}
printWriter.println();
}
}

0 comments on commit b181e0e

Please sign in to comment.