Author: lupus
Date: 2007-10-15 04:27:21 -0400 (Mon, 15 Oct 2007)
New Revision: 87484
Modified:
trunk/mono/mono/mini/ChangeLog
trunk/mono/mono/mini/mini-amd64.c
trunk/mono/mono/mini/mini-amd64.h
Log:
Mon Oct 15 10:41:27 CEST 2007 Paolo Molaro <[EMAIL PROTECTED]>
* mini-amd64.c, mini-amd64.h: amd64 support for the common vtable
trampoline.
Modified: trunk/mono/mono/mini/ChangeLog
===================================================================
--- trunk/mono/mono/mini/ChangeLog 2007-10-15 08:24:53 UTC (rev 87483)
+++ trunk/mono/mono/mini/ChangeLog 2007-10-15 08:27:21 UTC (rev 87484)
@@ -1,4 +1,9 @@
+Mon Oct 15 10:41:27 CEST 2007 Paolo Molaro <[EMAIL PROTECTED]>
+
+ * mini-amd64.c, mini-amd64.h: amd64 support for the common vtable
+ trampoline.
+
Mon Oct 15 10:39:26 CEST 2007 Paolo Molaro <[EMAIL PROTECTED]>
* mini-x86.c, mini-x86.h: x86 support for the common vtable
Modified: trunk/mono/mono/mini/mini-amd64.c
===================================================================
--- trunk/mono/mono/mini/mini-amd64.c 2007-10-15 08:24:53 UTC (rev 87483)
+++ trunk/mono/mono/mini/mini-amd64.c 2007-10-15 08:27:21 UTC (rev 87484)
@@ -5218,13 +5218,15 @@
return 3;
}
-gpointer*
-mono_arch_get_vcall_slot_addr (guint8* code, gpointer *regs)
+gpointer
+mono_arch_get_vcall_slot (guint8 *code, gpointer *regs, int *displacement)
{
guint32 reg;
gint32 disp;
guint8 rex = 0;
+ *displacement = 0;
+
/* go to the start of the call instruction
*
* address_byte = (m << 6) | (o << 3) | reg
@@ -5315,9 +5317,21 @@
/* R11 is clobbered by the trampoline code */
g_assert (reg != AMD64_R11);
- return (gpointer)(((guint64)(regs [reg])) + disp);
+ *displacement = disp;
+ return regs [reg];
}
+gpointer*
+mono_arch_get_vcall_slot_addr (guint8* code, gpointer *regs)
+{
+ gpointer vt;
+ int displacement;
+ vt = mono_arch_get_vcall_slot (code, regs, &displacement);
+ if (!vt)
+ return NULL;
+ return (gpointer*)((char*)vt + displacement);
+}
+
gpointer
mono_arch_get_this_arg_from_call (MonoMethodSignature *sig, gssize *regs,
guint8 *code)
{
Modified: trunk/mono/mono/mini/mini-amd64.h
===================================================================
--- trunk/mono/mono/mini/mini-amd64.h 2007-10-15 08:24:53 UTC (rev 87483)
+++ trunk/mono/mono/mini/mini-amd64.h 2007-10-15 08:27:21 UTC (rev 87484)
@@ -264,6 +264,7 @@
#define MONO_ARCH_HAVE_CREATE_VARS 1
#define MONO_ARCH_HAVE_IMT 1
#define MONO_ARCH_IMT_REG AMD64_R11
+#define MONO_ARCH_COMMON_VTABLE_TRAMPOLINE 1
#define MONO_ARCH_AOT_SUPPORTED 1
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches