+2008-08-02 Zoltan Varga <vargaz@gmail.com>
+ * mini-x86.c (mono_arch_get_argument_info): Rename frame_size to args_size,
+ and don't align it to MONO_ARCH_FRAME_ALIGNMENT.
+
+ * mini-x86.h: Change MONO_ARCH_FRAME_ALIGNMENT to 8 so doubles stored on
+ the stack are not unaligned. Fixes #413247.
+
Fri Aug 1 18:46:42 CEST 2008 Paolo Molaro <lupus@ximian.com>
* mini.c: update jitted methods performance counters.
* Gathers information on parameters such as size, alignment and
* padding. arg_info should be large enought to hold param_count + 1 entries.
*
- * Returns the size of the activation frame.
+ * Returns the size of the argument area on the stack.
*/
int
mono_arch_get_argument_info (MonoMethodSignature *csig, int param_count, MonoJitArgumentInfo *arg_info)
{
- int k, frame_size = 0;
+ int k, args_size = 0;
int size, pad;
guint32 align;
int offset = 8;
cinfo = get_call_info (NULL, NULL, csig, FALSE);
if (MONO_TYPE_ISSTRUCT (csig->ret) && (cinfo->ret.storage == ArgOnStack)) {
- frame_size += sizeof (gpointer);
+ args_size += sizeof (gpointer);
offset += 4;
}
arg_info [0].offset = offset;
if (csig->hasthis) {
- frame_size += sizeof (gpointer);
+ args_size += sizeof (gpointer);
offset += 4;
}
- arg_info [0].size = frame_size;
+ arg_info [0].size = args_size;
for (k = 0; k < param_count; k++) {
/* ignore alignment for now */
align = 1;
- frame_size += pad = (align - (frame_size & (align - 1))) & (align - 1);
+ args_size += pad = (align - (frame_size & (align - 1))) & (align - 1);
arg_info [k].pad = pad;
- frame_size += size;
+ args_size += size;
arg_info [k + 1].pad = 0;
arg_info [k + 1].size = size;
offset += pad;
offset += size;
}
- align = MONO_ARCH_FRAME_ALIGNMENT;
- frame_size += pad = (align - (frame_size & (align - 1))) & (align - 1);
+ align = 4;
+ args_size += pad = (align - (args_size & (align - 1))) & (align - 1);
arg_info [k].pad = pad;
g_free (cinfo);
- return frame_size;
+ return args_size;
}
static const guchar cpuid_impl [] = {
#if __APPLE__
#define MONO_ARCH_FRAME_ALIGNMENT 16
#else
-#define MONO_ARCH_FRAME_ALIGNMENT 4
+/* For storing doubles on the stack */
+#define MONO_ARCH_FRAME_ALIGNMENT 8
#endif
/* fixme: align to 16byte instead of 32byte (we align to 32byte to get