2008-08-02 Zoltan Varga <vargaz@gmail.com>
authorZoltan Varga <vargaz@gmail.com>
Sat, 2 Aug 2008 15:40:34 +0000 (15:40 -0000)
committerZoltan Varga <vargaz@gmail.com>
Sat, 2 Aug 2008 15:40:34 +0000 (15:40 -0000)
* 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.

svn path=/trunk/mono/; revision=109493

mono/mini/ChangeLog
mono/mini/mini-x86.c
mono/mini/mini-x86.h

index 5de719f7d5d2bb3ba052b5a4a80580e98d40429d..1bc26e957ccdeed4366797e9ca3ba951a6b42875 100644 (file)
@@ -1,4 +1,11 @@
+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.
index 2f0fb4e4b015535651dc3e30e4c11f87a97934cf..2c0d03fd693e7dce4d8aa8dc18eca1403ece653c 100644 (file)
@@ -464,12 +464,12 @@ get_call_info (MonoGenericSharingContext *gsctx, MonoMemPool *mp, MonoMethodSign
  * 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;
@@ -478,18 +478,18 @@ mono_arch_get_argument_info (MonoMethodSignature *csig, int param_count, MonoJit
        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++) {
                
@@ -504,9 +504,9 @@ mono_arch_get_argument_info (MonoMethodSignature *csig, int param_count, MonoJit
                /* 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;
@@ -514,13 +514,13 @@ mono_arch_get_argument_info (MonoMethodSignature *csig, int param_count, MonoJit
                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 [] = {
index 1e0b61c598040fdfbe5d41d6201f5ed85931ba27..b76f5e82804aaa2addae60ca3364a13d93dac905 100644 (file)
@@ -101,7 +101,8 @@ LONG CALLBACK seh_handler(EXCEPTION_POINTERS* ep);
 #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