[Mono-dev] [Mono-patches] r135715 - trunk/mono/mono/mini

Rodrigo Kumpera kumpera at gmail.com
Mon Jun 8 23:00:41 EDT 2009


Zoltan, BLX is ARMv5 only. I believe we still have to support v4.



On Mon, Jun 8, 2009 at 11:22 PM, Zoltan Varga (vargaz AT gmail.com) <
mono-patches-list at lists.ximian.com> wrote:

> Author: zoltan
> Date: 2009-06-08 22:22:25 -0400 (Mon, 08 Jun 2009)
> New Revision: 135715
>
> Modified:
>   trunk/mono/mono/mini/ChangeLog
>   trunk/mono/mono/mini/aot-compiler.c
>   trunk/mono/mono/mini/tramp-arm.c
> Log:
> 2009-06-09  Zoltan Varga  <vargaz at gmail.com>
>
>        * aot-compiler.c (arch_emit_specific_trampoline): Rework the arm
>        trampoline to save 8 bytes per trampoline.
>
>        * tramp-arm.c (mono_arch_create_trampoline_code_full): Update after
> the
>        change above.
>
> Modified: trunk/mono/mono/mini/ChangeLog
> ===================================================================
> --- trunk/mono/mono/mini/ChangeLog      2009-06-09 02:21:21 UTC (rev
> 135714)
> +++ trunk/mono/mono/mini/ChangeLog      2009-06-09 02:22:25 UTC (rev
> 135715)
> @@ -1,3 +1,11 @@
> +2009-06-09  Zoltan Varga  <vargaz at gmail.com>
> +
> +       * aot-compiler.c (arch_emit_specific_trampoline): Rework the arm
> +       trampoline to save 8 bytes per trampoline.
> +
> +       * tramp-arm.c (mono_arch_create_trampoline_code_full): Update after
> the
> +       change above.
> +
>  2009-06-08  Zoltan Varga  <vargaz at gmail.com>
>
>        * aot-compiler.c: Use acfg->temp_prefix instead of .L to prefix
> labels.
>
> Modified: trunk/mono/mono/mini/aot-compiler.c
> ===================================================================
> --- trunk/mono/mono/mini/aot-compiler.c 2009-06-09 02:21:21 UTC (rev
> 135714)
> +++ trunk/mono/mono/mini/aot-compiler.c 2009-06-09 02:22:25 UTC (rev
> 135715)
> @@ -605,23 +605,26 @@
>        guint8 buf [128];
>        guint8 *code;
>
> -       /* This should be exactly 28 bytes long */
> -       *tramp_size = 28;
> +       /* This should be exactly 20 bytes long */
> +       *tramp_size = 20;
>        code = buf;
>        ARM_PUSH (code, 0x5fff);
> -       ARM_LDR_IMM (code, ARMREG_R1, ARMREG_PC, 8);
> +       ARM_LDR_IMM (code, ARMREG_R1, ARMREG_PC, 4);
>        /* Load the value from the GOT */
>        ARM_LDR_REG_REG (code, ARMREG_R1, ARMREG_PC, ARMREG_R1);
>        /* Branch to it */
> -       ARM_MOV_REG_REG (code, ARMREG_LR, ARMREG_PC);
> -       ARM_MOV_REG_REG (code, ARMREG_PC, ARMREG_R1);
> +       ARM_BLX_REG (code, ARMREG_R1);
>
> -       g_assert (code - buf == 20);
> +       g_assert (code - buf == 16);
>
>        /* Emit it */
>        emit_bytes (acfg, buf, code - buf);
> -       emit_symbol_diff (acfg, acfg->got_symbol, ".", (offset * sizeof
> (gpointer)) - 4 + 8);
> -       emit_symbol_diff (acfg, acfg->got_symbol, ".", ((offset + 1) *
> sizeof (gpointer)) - 4 + 8);
> +       /*
> +        * Only one offset is needed, since the second one would be equal
> to the
> +        * first one.
> +        */
> +       emit_symbol_diff (acfg, acfg->got_symbol, ".", (offset * sizeof
> (gpointer)) - 4 + 4);
> +       //emit_symbol_diff (acfg, acfg->got_symbol, ".", ((offset + 1) *
> sizeof (gpointer)) - 4 + 8);
>  #else
>        g_assert_not_reached ();
>  #endif
>
> Modified: trunk/mono/mono/mini/tramp-arm.c
> ===================================================================
> --- trunk/mono/mono/mini/tramp-arm.c    2009-06-09 02:21:21 UTC (rev
> 135714)
> +++ trunk/mono/mono/mini/tramp-arm.c    2009-06-09 02:22:25 UTC (rev
> 135715)
> @@ -89,7 +89,7 @@
>
>        ARM_LDR_IMM (code, MONO_ARCH_RGCTX_REG, ARMREG_PC, 0);
>        ARM_LDR_IMM (code, ARMREG_PC, ARMREG_PC, 0);
> -       *(guint32*)code = mrgctx;
> +       *(guint32*)code = (guint32)mrgctx;
>        code += 4;
>        *(guint32*)code = (guint32)addr;
>        code += 4;
> @@ -227,10 +227,12 @@
>        ARM_MOV_REG_REG (code, ARMREG_V1, ARMREG_SP);
>        if (aot && tramp_type != MONO_TRAMPOLINE_GENERIC_CLASS_INIT) {
>                /*
> -                * The trampoline contains a pc-relative offset to the got
> slot where the
> -                * value is stored. The offset can be found at [lr + 4].
> +                * The trampoline contains a pc-relative offset to the got
> slot
> +                * preceeding the got slot where the value is stored. The
> offset can be
> +                * found at [lr + 0].
>                 */
> -               ARM_LDR_IMM (code, ARMREG_V2, ARMREG_LR, 4);
> +               ARM_LDR_IMM (code, ARMREG_V2, ARMREG_LR, 0);
> +               ARM_ADD_REG_IMM (code, ARMREG_V2, ARMREG_V2, 4, 0);
>                ARM_LDR_REG_REG (code, ARMREG_V2, ARMREG_V2, ARMREG_LR);
>        } else {
>                if (tramp_type != MONO_TRAMPOLINE_GENERIC_CLASS_INIT)
>
> _______________________________________________
> Mono-patches maillist  -  Mono-patches at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-patches
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20090609/1e1c70a8/attachment.html 


More information about the Mono-devel-list mailing list