From 1e3e7b077f708aefd2e866eca85abc822ae4cd02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herbert=20D=C3=BCrr?= Date: Thu, 13 Feb 2014 13:21:50 +0000 Subject: [PATCH] Resolves: #i124086# preserve 16byte stack alignment... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit in gcc3-solaris-intel's uno2cpp bridge Patch-by: Apostolos Syropoulos Review-by: Herbert Dürr (cherry picked from commit 95eeed58af27c63977a43c4d688b1467ef3cf047) Conflicts: bridges/source/cpp_uno/gcc3_solaris_intel/uno2cpp.cxx Change-Id: I92a151c5d65f685a6249954b84da31471501ff9b --- .../cpp_uno/gcc3_solaris_intel/uno2cpp.cxx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/bridges/source/cpp_uno/gcc3_solaris_intel/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_solaris_intel/uno2cpp.cxx index 2999fffe886e..3d7ef690d6bc 100644 --- a/bridges/source/cpp_uno/gcc3_solaris_intel/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_solaris_intel/uno2cpp.cxx @@ -39,7 +39,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, @@ -61,6 +69,13 @@ static void callVirtualMethod( void * stackptr; asm volatile ( "mov %%esp, %2\n\t" + // preserve potential 128bit stack alignment + "and $0xfffffff0, %%esp\n\t" + "mov %3, %%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 %3, %%eax\n\t" "mov %%eax, %%edx\n\t"