2009-09-05 Rodrigo Kumpera <rkumpera@novell.com>
authorRodrigo Kumpera <kumpera@gmail.com>
Sun, 6 Sep 2009 02:14:31 +0000 (02:14 -0000)
committerRodrigo Kumpera <kumpera@gmail.com>
Sun, 6 Sep 2009 02:14:31 +0000 (02:14 -0000)
* mini-x86.c (needs_stack_frame): OSX requires full frames to keep proper alignment.

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

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

index 7f21df4c9b7870262352e98ba60f1792c3c29017..913bc668888c253988d41235e5ea04c88070a631 100644 (file)
@@ -1,3 +1,7 @@
+2009-09-05  Rodrigo Kumpera  <rkumpera@novell.com>
+
+       * mini-x86.c (needs_stack_frame): OSX requires full frames to keep proper alignment.
+
 2009-09-06  Zoltan Varga  <vargaz@gmail.com>
 
        * mini-llvm.c (mono_llvm_emit_method): Handle unsigned volatile variables
index 283b334bd26af65bfcaa6e0b597da9efb6622f44..bbed7efff2e51aae9e1a44ffc1ce3b6e48e26858 100644 (file)
@@ -871,6 +871,11 @@ needs_stack_frame (MonoCompile *cfg)
        MonoMethodHeader *header;
        gboolean result = FALSE;
 
+#if defined(__APPLE__)
+       /*OSX requires stack frame code to have the correct alignment. */
+       return TRUE;
+#endif
+
        if (cfg->arch.need_stack_frame_inited)
                return cfg->arch.need_stack_frame;
 
@@ -4892,6 +4897,8 @@ mono_arch_emit_exceptions (MonoCompile *cfg)
                                /* Compute size of code following the push <OFFSET> */
                                size = 5 + 5;
 
+                               /*This is aligned to 16 bytes by the callee. This way we save a few bytes here.*/
+
                                if ((code - cfg->native_code) - throw_ip < 126 - size) {
                                        /* Use the shorter form */
                                        buf = buf2 = code;