}
instructions.add(new InsnNode(retinst));
}
private int saveArg(InsnList il, int ltmp, Type at) {
il.add(new InsnNode(Opcodes.DUP));
il.add(intNode(ltmp));
int opc;
String ty = null, desc = null;
switch (at.getSort()) {
case Type.BOOLEAN:
case Type.CHAR:
case Type.INT:
case Type.SHORT:
case Type.BYTE:
opc = Opcodes.ILOAD; ty = "java/lang/Integer"; desc = "(I)V"; break;
case Type.LONG:
opc = Opcodes.LLOAD; ty = "java/lang/Long"; desc = "(J)V"; break;
case Type.FLOAT:
opc = Opcodes.FLOAD; ty = "java/lang/Float"; desc = "(F)V"; break;
case Type.DOUBLE:
opc = Opcodes.DLOAD; ty = "java/lang/Double"; desc = "(D)V"; break;
default:
opc = Opcodes.ALOAD; break;
}
if (ty != null) {
il.add(new TypeInsnNode(Opcodes.NEW, ty));
il.add(new InsnNode(Opcodes.DUP));
}
il.add(new VarInsnNode(opc, ltmp));
if (ty != null) il.add(new MethodInsnNode(Opcodes.INVOKESPECIAL, ty, "<init>", desc));
il.add(new InsnNode(Opcodes.AASTORE));
return at.getSize();
}