[Mono-dev] JIT: MonoReg to replace gssize for registers

Zoltan Varga vargaz at gmail.com
Sun Dec 14 04:13:59 EST 2008


Hi,

  There is already a type for this called 'greg_t' on linux. So it
might be useful to name the
new type something similar, like mgreg_t, or something. Other than
that, based on the
discussion, I think this is ok to check in.

                Zoltan

On Thu, Dec 11, 2008 at 8:40 PM, Mark Mason <mmason at upwardaccess.com> wrote:
> Hello all,
>
> Along the same lines as the SIZEOF_VOID_P change, I'd like to offer the
> following new type to replace to use of 'gssize' when referring to a
> machine register. 'gssize' comes from glib, and simply represents the
> size of an integer -- which is not necessarily always the same as the
> size of the underlying integer registers.
>
> There are some other uses of gssize in mini/ that will need to be
> updated as well, but this is a start.
>
> Comments most welcome.
>
> Thanks in advance,
> Mark
>
> Index: mini.h
> ===================================================================
> --- mini.h      (revision 121269)
> +++ mini.h      (working copy)
> @@ -400,6 +400,13 @@
>        int size, align;
>  } MonoMemcpyArgs;
>
> +/* C type matching the size of a machine register. Not always the same
> as 'int' */
> +#if SIZEOF_REGISTER == 4
> +typedef gint32 MonoReg;
> +#elif SIZEOF_REGISTER == 8
> +typedef gint64 MonoReg;
> +#endif
> +
>  struct MonoInst {
>        guint16 opcode;
>        guint8  type; /* stack type */
> @@ -415,7 +422,7 @@
>                union {
>                        MonoInst *src;
>                        MonoMethodVar *var;
> -                       gssize const_val;
> +                       MonoReg const_val;
>                        gpointer p;
>                        MonoMethod *method;
>                        MonoMethodSignature *signature;
>
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>


More information about the Mono-devel-list mailing list