summaryrefslogtreecommitdiff
path: root/bridges
diff options
context:
space:
mode:
authorjan Iversen <jani@libreoffice.org>2018-03-15 13:26:41 +0100
committerjan Iversen <jani@libreoffice.org>2018-03-15 13:28:25 +0100
commit1caf3b9380f3873b7ca165a743f65d332e46ea66 (patch)
treeef762f5c6ad73f820fcffac635dc15e6f04c8ac7 /bridges
parent953a5cb1c8c750df24ed0316349a5916c384296d (diff)
iOS, solved corrupted stack in cpp -> uno
Solved problem in assembler code, so the call chain is correct. There are still something missing for uno to work correctly Change-Id: Ieb3b3d6b15153576159e07b52ced0efedd135713
Diffstat (limited to 'bridges')
-rw-r--r--bridges/source/cpp_uno/gcc3_ios/cpp2uno.cxx34
-rw-r--r--bridges/source/cpp_uno/gcc3_ios/ios64_helper.s40
2 files changed, 38 insertions, 36 deletions
diff --git a/bridges/source/cpp_uno/gcc3_ios/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_ios/cpp2uno.cxx
index 98d859c69cde..1e2e94d090b2 100644
--- a/bridges/source/cpp_uno/gcc3_ios/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/gcc3_ios/cpp2uno.cxx
@@ -30,40 +30,6 @@
#include "share.hxx"
-// Snippet code done inline
-extern "C" void privateSnippetExecutor()
-{
- // _privateSnippetExecutor is jumped to from each codeSnippet_*
- asm volatile (
- // Store potential args in general purpose registers
- " stp x6, x7, [sp, #-16]!\n"
- " stp x4, x5, [sp, #-16]!\n"
- " stp x2, x3, [sp, #-16]!\n"
- " stp x0, x1, [sp, #-16]!\n"
-
- // Store potential args in floating point/SIMD registers
- " stp d6, d7, [sp, #-16]!\n"
- " stp d4, d5, [sp, #-16]!\n"
- " stp d2, d3, [sp, #-16]!\n"
- " stp d0, d1, [sp, #-16]!\n"
-
- // First argument to cpp_vtable_call: The x15 set up in the codeSnippet instance
- " mov x0, x15\n"
-
- // Store x8 (potential pointer to return value storage) and lr
- " stp x8, lr, [sp, #-16]!\n"
-
- // Second argument: The pointer to all the above
- " mov x1, sp\n"
-
- " b _cpp_vtable_call\n"
-
- " ldp x8, lr, [sp, #0]\n"
- " add sp, sp, #144\n"
-// " ret lr\n"
- );
-}
-
extern "C" {
extern int nFunIndexes, nVtableOffsets;
diff --git a/bridges/source/cpp_uno/gcc3_ios/ios64_helper.s b/bridges/source/cpp_uno/gcc3_ios/ios64_helper.s
index 14a62a012e11..6737f73dde6f 100644
--- a/bridges/source/cpp_uno/gcc3_ios/ios64_helper.s
+++ b/bridges/source/cpp_uno/gcc3_ios/ios64_helper.s
@@ -16,9 +16,9 @@
// except in compliance with the License. You may obtain a copy of
// the License at http://www.apache.org/licenses/LICENSE-2.0 .
//
- .text
- .align 4
+ .section __TEXT,__text,regular,pure_instructions
+ .p2align 2
codeSnippet_00000000_0:
adr x15, .+8
b _privateSnippetExecutor
@@ -221,4 +221,40 @@ _codeSnippets:
.long codeSnippet_00000007_3 - _codeSnippets
+
+ .private_extern _privateSnippetExecutor
+ .globl _privateSnippetExecutor
+ .p2align 2
+_privateSnippetExecutor:
+ .cfi_startproc
+ .cfi_def_cfa w29, 16
+ .cfi_offset w30, -8
+ .cfi_offset w29, -16
+
+ // _privateSnippetExecutor is jumped to from codeSnippet_*
+
+ // push all GP, FP/SIMD registers to the stack
+ stp x6, x7, [sp, #-16]!
+ stp x4, x5, [sp, #-16]!
+ stp x2, x3, [sp, #-16]!
+ stp x0, x1, [sp, #-16]!
+ stp d6, d7, [sp, #-16]!
+ stp d4, d5, [sp, #-16]!
+ stp d2, d3, [sp, #-16]!
+ stp d0, d1, [sp, #-16]!
+
+ // push x8 (RC pointer) and lr to stack
+ stp x8, lr, [sp, #-16]!
+
+ // First argument (x15 set up in the codeSnippet instance)
+ // Second argument: The pointer to all the above
+ mov x0, x15
+ mov x1, sp
+
+ bl _cpp_vtable_call
+ ldp x8, lr, [sp, #0]
+ add sp, sp, #144
+ ret lr
+ .cfi_endproc
+
// vim:set shiftwidth=4 softtabstop=4 expandtab: