|
19 | 19 | import org.objectweb.asm.tree.IincInsnNode;
|
20 | 20 | import org.objectweb.asm.tree.InsnNode;
|
21 | 21 | import org.objectweb.asm.tree.IntInsnNode;
|
| 22 | +import org.objectweb.asm.tree.InvokeDynamicInsnNode; |
22 | 23 | import org.objectweb.asm.tree.JumpInsnNode;
|
23 | 24 | import org.objectweb.asm.tree.LabelNode;
|
24 | 25 | import org.objectweb.asm.tree.LdcInsnNode;
|
@@ -128,6 +129,8 @@ public ArrayList<String> createPrint() {
|
128 | 129 | line = printTableSwitchInsnNode((TableSwitchInsnNode) ain);
|
129 | 130 | } else if (ain instanceof LookupSwitchInsnNode) {
|
130 | 131 | line = printLookupSwitchInsnNode((LookupSwitchInsnNode) ain);
|
| 132 | + } else if (ain instanceof InvokeDynamicInsnNode) { |
| 133 | + line = printInvokeDynamicInsNode((InvokeDynamicInsnNode) ain); |
131 | 134 | } else {
|
132 | 135 | line += "UNADDED OPCODE: " + nameOpcode(ain.opcode()) + " "
|
133 | 136 | + ain.toString();
|
@@ -281,6 +284,29 @@ protected String printLookupSwitchInsnNode(LookupSwitchInsnNode lin) {
|
281 | 284 | return line;
|
282 | 285 | }
|
283 | 286 |
|
| 287 | + protected String printInvokeDynamicInsNode(InvokeDynamicInsnNode idin) { |
| 288 | + StringBuilder sb = new StringBuilder(); |
| 289 | + sb.append(nameOpcode(idin.opcode()) + " " + idin.name + "("); |
| 290 | + |
| 291 | + String desc = idin.desc; |
| 292 | + String partedDesc = idin.desc.substring(2); |
| 293 | + try { |
| 294 | + if(Type.getType(partedDesc) != null) |
| 295 | + desc = Type.getType(partedDesc).getClassName(); |
| 296 | + |
| 297 | + if (desc == null || desc.equals("null")) |
| 298 | + desc = idin.desc; |
| 299 | + } catch(java.lang.ArrayIndexOutOfBoundsException e) { |
| 300 | + |
| 301 | + } |
| 302 | + |
| 303 | + sb.append(desc); |
| 304 | + |
| 305 | + sb.append(");"); |
| 306 | + |
| 307 | + return sb.toString(); |
| 308 | + } |
| 309 | + |
284 | 310 | protected String nameOpcode(int opcode) {
|
285 | 311 | return " " + OpcodeInfo.OPCODES.get(opcode).toLowerCase();
|
286 | 312 | }
|
|
0 commit comments