summaryrefslogtreecommitdiff
path: root/bridges
diff options
context:
space:
mode:
authorsb <sb@openoffice.org>2010-02-01 09:40:00 +0100
committersb <sb@openoffice.org>2010-02-01 09:40:00 +0100
commit9db629b81c9eea95500ea5d8d76f83371d6c8913 (patch)
tree6b498ce4ac59579cb77d290f5084d79b2024c3f8 /bridges
parent47c85e8c012553e33947bca61cf268b6808bbcfd (diff)
sb119: #i108371# preserve potential 128bit stack alignment in gcc3_linux_intel UNO bridge (based on a patch by ecatmur)
Diffstat (limited to 'bridges')
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_intel/call.s16
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx7
2 files changed, 18 insertions, 5 deletions
diff --git a/bridges/source/cpp_uno/gcc3_linux_intel/call.s b/bridges/source/cpp_uno/gcc3_linux_intel/call.s
index f345e3a76..45d7c5308 100644
--- a/bridges/source/cpp_uno/gcc3_linux_intel/call.s
+++ b/bridges/source/cpp_uno/gcc3_linux_intel/call.s
@@ -9,7 +9,8 @@ privateSnippetExecutorGeneral:
.LCFIg0:
movl %esp,%ebp
.LCFIg1:
- subl $0x4,%esp # 32bit returnValue
+ subl $0x8,%esp # 32bit returnValue, and preserve potential 128bit
+ # stack alignment
pushl %esp # 32bit &returnValue
pushl %ecx # 32bit pCallStack
pushl %edx # 32bit nVtableOffset
@@ -30,6 +31,7 @@ privateSnippetExecutorVoid:
.LCFIv0:
movl %esp,%ebp
.LCFIv1:
+ andl $0xFFFFFFF0,%esp # preserve potential 128bit stack alignment
pushl $0 # 32bit null pointer (returnValue not used)
pushl %ecx # 32bit pCallStack
pushl %edx # 32bit nVtableOffset
@@ -49,7 +51,8 @@ privateSnippetExecutorHyper:
.LCFIh0:
movl %esp,%ebp
.LCFIh1:
- subl $0x8,%esp # 64bit returnValue
+ subl $0x8,%esp # 64bit returnValue (preserves potential 128bit
+ # stack alignment)
pushl %esp # 32bit &returnValue
pushl %ecx # 32bit pCallStack
pushl %edx # 32bit nVtableOffset
@@ -71,7 +74,8 @@ privateSnippetExecutorFloat:
.LCFIf0:
movl %esp,%ebp
.LCFIf1:
- subl $0x4,%esp # 32bit returnValue
+ subl $0x8,%esp # 32bit returnValue, and preserve potential 128bit
+ # stack alignment
pushl %esp # 32bit &returnValue
pushl %ecx # 32bit pCallStack
pushl %edx # 32bit nVtableOffset
@@ -92,7 +96,8 @@ privateSnippetExecutorDouble:
.LCFId0:
movl %esp,%ebp
.LCFId1:
- subl $0x8,%esp # 64bit returnValue
+ subl $0x8,%esp # 64bit returnValue (preserves potential 128bit
+ # stack alignment)
pushl %esp # 32bit &returnValue
pushl %ecx # 32bit pCallStack
pushl %edx # 32bit nVtableOffset
@@ -113,7 +118,8 @@ privateSnippetExecutorClass:
.LCFIc0:
movl %esp,%ebp
.LCFIc1:
- subl $0x4,%esp # 32bit returnValue
+ subl $0x8,%esp # 32bit returnValue, and preserve potential 128bit
+ # stack alignment
pushl %esp # 32bit &returnValue
pushl %ecx # 32bit pCallStack
pushl %edx # 32bit nVtableOffset
diff --git a/bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx
index 7c09fa89c..d925af49f 100644
--- a/bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx
@@ -87,6 +87,13 @@ 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"