You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by hd...@apache.org on 2014/02/13 14:21:51 UTC

svn commit: r1567914 - /openoffice/trunk/main/bridges/source/cpp_uno/gcc3_solaris_intel/uno2cpp.cxx

Author: hdu
Date: Thu Feb 13 13:21:50 2014
New Revision: 1567914

URL: http://svn.apache.org/r1567914
Log:
#i124086# preserve 16byte stack alignment in gcc3-solaris-intel's uno2cpp bridge

Patch-by: Apostolos Syropoulos <as...@hotmail.com>
Review-by: Herbert Dürr <hd...@apache.org>

Modified:
    openoffice/trunk/main/bridges/source/cpp_uno/gcc3_solaris_intel/uno2cpp.cxx

Modified: openoffice/trunk/main/bridges/source/cpp_uno/gcc3_solaris_intel/uno2cpp.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/bridges/source/cpp_uno/gcc3_solaris_intel/uno2cpp.cxx?rev=1567914&r1=1567913&r2=1567914&view=diff
==============================================================================
--- openoffice/trunk/main/bridges/source/cpp_uno/gcc3_solaris_intel/uno2cpp.cxx (original)
+++ openoffice/trunk/main/bridges/source/cpp_uno/gcc3_solaris_intel/uno2cpp.cxx Thu Feb 13 13:21:50 2014
@@ -45,7 +45,15 @@ namespace
 {
 
 //==================================================================================================
-static void callVirtualMethod(
+void callVirtualMethod(
+    void * pAdjustedThisPtr,
+    sal_Int32 nVtableIndex,
+    void * pRegisterReturn,
+    typelib_TypeClass eReturnType,
+    sal_Int32 * pStackLongs,
+    sal_Int32 nStackLongs ) __attribute__((noinline));
+
+void callVirtualMethod(
     void * pAdjustedThisPtr,
     sal_Int32 nVtableIndex,
     void * pRegisterReturn,
@@ -67,6 +75,13 @@ static void callVirtualMethod(
     void * stackptr;
 	asm volatile (
         "mov   %%esp, %6\n\t"
+       // preserve potential 128bit stack alignment
+        "and   $0xfffffff0, %%esp\n\t"
+        "mov   %0, %%eax\n\t"
+        "lea   -4(,%%eax,4), %%eax\n\t"
+        "and   $0xf, %%eax\n\t"
+        "sub   $0xc, %%eax\n\t"
+        "add   %%eax, %%esp\n\t"
 		// copy values
 		"mov   %0, %%eax\n\t"
 		"mov   %%eax, %%edx\n\t"