Kaydet (Commit) 056bc3cf authored tarafından jan Iversen's avatar jan Iversen

iOS, moved privateSnippetExecutor from asm to C function.

move asm code to C as first step towards reducing the asm code.
Since iOS does not permit java/python or anything else than the
compiled C++ code, the throw should be done simpler.

Apart from that this is the first step in solving a stack
corruption problem in the throw code

Change-Id: I4f3d3a3ba3f55fb46131d9a8eeb0deebf179d95f
üst e42d869a
......@@ -17,14 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
// For iOS devices (64-bit ARM). Originally a copy of
// ../gcc3_linux_arm/cpp2uno.cxx.
// No attempts at factoring out the large amounts of more or less
// common code in this, cpp2uno-arm.cxx and cpp2uno-i386.cxx have been
// done. Which is sad. But then the whole bridges/source/cpp_uno is
// full of copy/paste. So I continue in that tradition...
#include <com/sun/star/uno/RuntimeException.hpp>
#include <sal/log.hxx>
#include <uno/data.h>
......@@ -37,6 +29,42 @@
#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"
" bl _cpp_vtable_call\n"
" ldp x8, lr, [sp, #0]\n"
" add sp, sp, #144\n"
" ret lr\n"
);
}
extern "C" {
extern int nFunIndexes, nVtableOffsets;
extern int codeSnippets[];
......
......@@ -221,40 +221,4 @@ _codeSnippets:
.long codeSnippet_00000007_3 - _codeSnippets
.text
.align 4
_privateSnippetExecutor:
.cfi_startproc
// _privateSnippetExecutor is jumped to from each of the
// codeSnippet_* generated by generate-snippets.pl
// Store potential args in general purpose registers
stp x6, x7, [sp, #-16]!
stp x4, x5, [sp, #-16]!
stp x2, x3, [sp, #-16]!
stp x0, x1, [sp, #-16]!
// Store potential args in floating point/SIMD registers
stp d6, d7, [sp, #-16]!
stp d4, d5, [sp, #-16]!
stp d2, d3, [sp, #-16]!
stp d0, d1, [sp, #-16]!
// First argument to cpp_vtable_call: The x15 set up in the codeSnippet instance
mov x0, x15
// Store x8 (potential pointer to return value storage) and lr
stp x8, lr, [sp, #-16]!
// Second argument: The pointer to all the above
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:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment