[Libreoffice-commits] core.git: bridges/source

jan Iversen jani at libreoffice.org
Tue Mar 20 12:18:21 UTC 2018


 bridges/source/cpp_uno/gcc3_ios/cpp2uno.cxx    |   39 ++++++-------------------
 bridges/source/cpp_uno/gcc3_ios/ios64_helper.s |   12 ++++---
 2 files changed, 17 insertions(+), 34 deletions(-)

New commits:
commit 5747ed051440a8baff4b503b3b45146510f198bc
Author: jan Iversen <jani at libreoffice.org>
Date:   Tue Mar 20 13:14:07 2018 +0100

    iOS, simplified assembler
    
    RC of cpp_vtable_call is never used in the asm part, so remove it.
    
    Change-Id: Iabda12541fbb574a21395a8430c52a3e9f892947

diff --git a/bridges/source/cpp_uno/gcc3_ios/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_ios/cpp2uno.cxx
index 9ad3954e4504..4c7bb8354ab1 100644
--- a/bridges/source/cpp_uno/gcc3_ios/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/gcc3_ios/cpp2uno.cxx
@@ -290,11 +290,13 @@ namespace
     }
 
 
-    static typelib_TypeClass cpp_mediate( sal_Int32 nFunctionIndex,
-                                          sal_Int32 nVtableOffset,
-                                          void ** pCallStack,
-                                          sal_Int64 * pRegisterReturn )
+    static void cpp_mediate(sal_Int32 nFunctionIndex,
+                            sal_Int32 nVtableOffset,
+                            void ** pCallStack)
     {
+        sal_Int64 nRegReturn;
+        sal_Int64 *pRegisterReturn = &nRegReturn;
+
         // pCallStack: x8, lr, d0..d7, x0..x7, rest of params originally on stack
         // _this_ ptr is patched cppu_XInterfaceProxy object
         void *pThis = pCallStack[2 + 8];
@@ -409,7 +411,8 @@ namespace
         }
         }
 
-        return eRet;
+        (void)eRet;
+        return;
     }
 }
 
@@ -419,31 +422,9 @@ namespace
  */
 
 extern "C" void cpp_vtable_call( sal_Int32 func, sal_Int32 offset,
-                                 void **pCallStack )
+                                 void **pStack )
 {
-    sal_Int64 nRegReturn;
-    typelib_TypeClass aType = cpp_mediate( func, offset, pCallStack, &nRegReturn );
-
-    switch( aType )
-    {
-        case typelib_TypeClass_BOOLEAN:
-        case typelib_TypeClass_BYTE:
-            nRegReturn = (unsigned long)(*(unsigned char *)&nRegReturn);
-            break;
-        case typelib_TypeClass_CHAR:
-        case typelib_TypeClass_UNSIGNED_SHORT:
-        case typelib_TypeClass_SHORT:
-            nRegReturn = (unsigned long)(*(unsigned short *)&nRegReturn);
-            break;
-        case typelib_TypeClass_ENUM:
-        case typelib_TypeClass_UNSIGNED_LONG:
-        case typelib_TypeClass_LONG:
-            nRegReturn = (unsigned long)(*(unsigned int *)&nRegReturn);
-            break;
-        case typelib_TypeClass_VOID:
-        default:
-            break;
-    }
+    cpp_mediate(func, offset, pStack);
 }
 
 namespace
diff --git a/bridges/source/cpp_uno/gcc3_ios/ios64_helper.s b/bridges/source/cpp_uno/gcc3_ios/ios64_helper.s
index e08910db8e55..12308f1a9855 100644
--- a/bridges/source/cpp_uno/gcc3_ios/ios64_helper.s
+++ b/bridges/source/cpp_uno/gcc3_ios/ios64_helper.s
@@ -199,8 +199,6 @@ _privateSnippetExecutor:
     .cfi_offset w29, -16
 
     // _privateSnippetExecutor is jumped to from codeSnippet_*
-    stp x29, x30, [sp, #-0x10]!
-    mov x29, sp
 
     // push all GP, FP/SIMD registers to the stack
     stp x6, x7, [sp, #-16]!
@@ -221,10 +219,14 @@ _privateSnippetExecutor:
     mov x1, x15
     mov x2, sp
     bl  _cpp_vtable_call
-    .globl _jantest
-    ldp     x8, lr, [sp, #0]
+
+    // restore x8 (RC pointer) and lr (skip RC from cpp_vtable_call)
+    ldp x8, lr, [sp, #0]
+
+    // restore stack
     add sp, sp, #144
-    ldp x29, x30, [sp], #0x10
+
+    // continue with throw/catch
     ret lr
     .cfi_endproc
 


More information about the Libreoffice-commits mailing list