On 07/12/07 Zoltan Varga (vargaz AT gmail.com) wrote:
> Modified: trunk/mono/mono/mini/mini-amd64.c
> ===================================================================
> --- trunk/mono/mono/mini/mini-amd64.c 2007-07-12 13:11:15 UTC (rev 81868)
> +++ trunk/mono/mono/mini/mini-amd64.c 2007-07-12 13:18:35 UTC (rev 81869)
> @@ -5175,7 +5175,20 @@
> * really careful about the ordering of the cases. Longer sequences
> * come first.
> */
> - if ((code [-1] == 0x8b) && (amd64_modrm_mod (code [0]) == 0x2) && (code
> [5] == 0xff) && (amd64_modrm_reg (code [6]) == 0x2) && (amd64_modrm_mod (code
> [6]) == 0x0)) {
> +#ifdef MONO_ARCH_HAVE_IMT
> + if ((code [-2] == 0x41) && (code [-1] == 0xbb) && (code [4] == 0xff) &&
> (x86_modrm_mod (code [5]) == 1) && (x86_modrm_reg (code [5]) == 2) &&
> ((signed char)code [6] < 0)) {
> + /* IMT-based interface calls: with MONO_ARCH_IMT_REG == r11
> + * 41 bb 14 f8 28 08 mov $0x828f814,%r11d
> + * ff 50 fc call *0xfffffffc(%rax)
> + */
> + reg = amd64_modrm_rm (code [5]);
> + disp = (signed char)code [6];
On amd64 you need to handle also the larger displacement since it's easy
for the offset to overflow a signed byte (max 32 IMT table entries *
sizeof (gpointer)). On x86 it's fine since the max becomes -128.
lupus
--
-----------------------------------------------------------------
[EMAIL PROTECTED] debian/rules
[EMAIL PROTECTED] Monkeys do it better
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches