static inline void add_general (guint *, size_data *, ArgInfo *, gboolean);
static inline void add_stackParm (guint *, size_data *, ArgInfo *, gint);
static inline void add_float (guint *, size_data *, ArgInfo *);
-static CallInfo * calculate_sizes (MonoMethodSignature *, size_data *, gboolean);
+static CallInfo * calculate_sizes (MonoCompile *, MonoMethodSignature *, size_data *, gboolean);
static void peephole_pass (MonoCompile *, MonoBasicBlock *);
static guchar * emit_float_to_int (MonoCompile *, guchar *, int, int, int, gboolean);
gpointer mono_arch_get_lmf_addr (void);
sig = mono_method_signature (method);
- cinfo = calculate_sizes (sig, &sz, sig->pinvoke);
+ cinfo = calculate_sizes (NULL, sig, &sz, sig->pinvoke);
if (cinfo->struct_ret) {
printf ("[STRUCTRET:%p], ", (gpointer) rParm->gr[0]);
/*------------------------------------------------------------------*/
static CallInfo *
-calculate_sizes (MonoMethodSignature *sig, size_data *sz,
+calculate_sizes (MonoCompile *cfg, MonoMethodSignature *sig, size_data *sz,
gboolean string_ctor)
{
guint i, fr, gr, size;
int nParm = sig->hasthis + sig->param_count;
+ MonoType *ret_type;
guint32 simpletype, align;
CallInfo *cinfo = g_malloc0 (sizeof (CallInfo) + sizeof (ArgInfo) * nParm);
+ MonoGenericSharingContext *gsctx = cfg ? cfg->generic_sharing_context : NULL;
fr = 0;
gr = s390_r2;
/* area that the callee will use. */
/*----------------------------------------------------------*/
- simpletype = mono_type_get_underlying_type (sig->ret)->type;
+ ret_type = mono_type_get_underlying_type (sig->ret);
+ ret_type = mini_get_basic_type_from_generic (gsctx, ret_type);
+ simpletype = ret_type->type;
enum_retvalue:
switch (simpletype) {
case MONO_TYPE_BOOLEAN:
/*----------------------------------------------------------*/
for (i = 0; i < sig->param_count; ++i) {
+ MonoType *ptype;
+
/*--------------------------------------------------*/
/* Handle vararg type calls. All args are put on */
/* the stack. */
continue;
}
- simpletype = mono_type_get_underlying_type(sig->params [i])->type;
+ ptype = mono_type_get_underlying_type (sig->params [i]);
+ ptype = mini_get_basic_type_from_generic (gsctx, ptype);
+ simpletype = ptype->type;
switch (simpletype) {
case MONO_TYPE_BOOLEAN:
case MONO_TYPE_I1:
sig = mono_method_signature (cfg->method);
- cinfo = calculate_sizes (sig, &sz, sig->pinvoke);
+ cinfo = calculate_sizes (cfg, sig, &sz, sig->pinvoke);
if (cinfo->struct_ret) {
cfg->ret->opcode = OP_REGVAR;
n = sig->param_count + sig->hasthis;
DEBUG (g_print ("Call requires: %d parameters\n",n));
- cinfo = calculate_sizes (sig, &sz, sig->pinvoke);
+ cinfo = calculate_sizes (cfg, sig, &sz, sig->pinvoke);
stackSize = sz.stack_size + sz.local_size + sz.parm_size + sz.offset;
call->stack_usage = MAX(stackSize, call->stack_usage);
sig = mono_method_signature (method);
pos = 0;
- cinfo = calculate_sizes (sig, &sz, sig->pinvoke);
+ cinfo = calculate_sizes (NULL, sig, &sz, sig->pinvoke);
if (cinfo->struct_ret) {
ArgInfo *ainfo = &cinfo->ret;
sig = mono_method_signature (method);
pos = 0;
- cinfo = calculate_sizes (sig, &sz, sig->pinvoke);
+ cinfo = calculate_sizes (cfg, sig, &sz, sig->pinvoke);
if (cinfo->struct_ret) {
ArgInfo *ainfo = &cinfo->ret;