[Openmcl-cvs-notifications] r13171 - /trunk/source/lisp-kernel/x86-spentry32.s

rme at clozure.com rme at clozure.com
Thu Nov 5 20:56:41 EST 2009


Author: rme
Date: Thu Nov  5 20:56:41 2009
New Revision: 13171

Log:
In .SPcallback, use the stack word -20(%ebp) to store the number of
words to discard for winapi/stdcall functions.  Now that we're doing
Objective-C stuff on Windows (which I didn't expect to be doing), take
care not to use locations/registers that the bridge wants to use for
dealing with NSExceptions.

Modified:
    trunk/source/lisp-kernel/x86-spentry32.s

Modified: trunk/source/lisp-kernel/x86-spentry32.s
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/lisp-kernel/x86-spentry32.s (original)
+++ trunk/source/lisp-kernel/x86-spentry32.s Thu Nov  5 20:56:41 2009
@@ -4323,7 +4323,7 @@
         __(movl %eax,%ecx)    /* extract args-discard count */
         __(shrl $24,%ecx)
         __(andl $0x007fffff,%eax) /* callback index */
-        __(movl %ecx,-12(%ebp))
+        __(movl %ecx,-20(%ebp))
         /* If the C stack is 16-byte aligned by convention,
            it should still be, and this'll be a NOP. */
         __(andl $~15,%esp)
@@ -4387,13 +4387,13 @@
 	__(pop %ebx)
 	__(pop %esi)
 	__(pop %edi)
+        __(movl -12(%ebp),%ecx) /* magic value for ObjC bridge */
         __(cmpb $1,-16(%ebp))
-        __(movl -12(%ebp),%ecx) /* magic value for ObjC bridge or winapi */
         __(jae 1f)
 	__(movl -8(%ebp),%eax)
         __(movl -4(%ebp),%edx)
         __ifdef([WIN_32])
-         __(testl %ecx,%ecx)
+	 __(cmpl $0,-20(%ebp))
          __(jne local_label(winapi_return))
 	__endif
         /* since we aligned the stack after pushing flags, we're not
@@ -4410,7 +4410,7 @@
         /* single float return in x87 */
         __(flds -8(%ebp))
         __ifdef([WIN_32])
-         __(testl %ecx,%ecx)
+	 __(cmpl $0,-20(%ebp))
          __(jne local_label(winapi_return))
         __endif
         __(leave)
@@ -4418,13 +4418,14 @@
 2:      /* double-float return in x87 */
         __(fldl -8(%ebp))
         __ifdef([WIN_32])
-         __(testl %ecx,%ecx)
+	 __(cmpl $0,-20(%ebp))
          __(jne local_label(winapi_return))
         __endif
         __(leave)
 	__(ret)
         __ifdef([WIN_32])
 local_label(winapi_return):
+	  __(movl -20(%ebp),%ecx)
 	  __(leave)
          /* %ecx is non-zero and contains count of arg words to pop */
           __(popl -4(%esp,%ecx,4))



More information about the Openmcl-cvs-notifications mailing list