incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p..@apache.org
Subject svn commit: r1226441 - in /incubator/ooo/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_intel: call.s uno2cpp.cxx
Date Mon, 02 Jan 2012 15:18:04 GMT
Author: pfg
Date: Mon Jan  2 15:18:03 2012
New Revision: 1226441

URL: http://svn.apache.org/viewvc?rev=1226441&view=rev
Log:
Update FreeBSD i386 bridge to preserve gcc 128 bit stack alignment. #i108371#

Modified:
    incubator/ooo/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_intel/call.s
    incubator/ooo/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_intel/uno2cpp.cxx

Modified: incubator/ooo/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_intel/call.s
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_intel/call.s?rev=1226441&r1=1226440&r2=1226441&view=diff
==============================================================================
--- incubator/ooo/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_intel/call.s (original)
+++ incubator/ooo/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_intel/call.s Mon Jan  2 15:18:03
2012
@@ -30,7 +30,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
@@ -51,6 +52,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
@@ -70,7 +72,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
@@ -92,7 +95,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
@@ -113,7 +117,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
@@ -134,7 +139,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

Modified: incubator/ooo/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_intel/uno2cpp.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_intel/uno2cpp.cxx?rev=1226441&r1=1226440&r2=1226441&view=diff
==============================================================================
--- incubator/ooo/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_intel/uno2cpp.cxx (original)
+++ incubator/ooo/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_intel/uno2cpp.cxx Mon Jan
 2 15:18:03 2012
@@ -80,6 +80,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"



Mime
View raw message