}
}
protected final void generateReturnWithObjectAtTopOfTheStack(String methodDesc)
{
Type returnType = Type.getReturnType(methodDesc);
int sort = returnType.getSort();
if (sort == Type.VOID) {
mw.visitInsn(POP);
}
else if (sort == Type.ARRAY) {
mw.visitTypeInsn(CHECKCAST, returnType.getDescriptor());
}
else if (sort == Type.OBJECT) {
mw.visitTypeInsn(CHECKCAST, returnType.getInternalName());
}
else {
String returnDesc = PRIMITIVE_WRAPPER_TYPE[sort];
mw.visitTypeInsn(CHECKCAST, returnDesc);
mw.visitMethodInsn(INVOKEVIRTUAL, returnDesc, UNBOXING_METHOD[sort], "()" + returnType);
}
mw.visitInsn(returnType.getOpcode(IRETURN));
}