diff options
author | zherczeg <zherczeg@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2013-02-20 09:59:29 +0000 |
---|---|---|
committer | zherczeg <zherczeg@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2013-02-20 09:59:29 +0000 |
commit | 86957348ae7fb586d050087ce90bbd1d3d8aae36 (patch) | |
tree | 38fb4a7c2cc4e11af55c9ae2f943bc7cdcd56af8 /sljit | |
parent | eb59ae4a9a1483b19877b80c607698571916215c (diff) | |
download | pcre-86957348ae7fb586d050087ce90bbd1d3d8aae36.tar.gz |
JIT compiler now supports 32 bit Macs thanks to Lawrence Velazquez.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1250 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'sljit')
-rw-r--r-- | sljit/sljitConfigInternal.h | 2 | ||||
-rw-r--r-- | sljit/sljitNativeX86_32.c | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/sljit/sljitConfigInternal.h b/sljit/sljitConfigInternal.h index 9e627fe..340dbf1 100644 --- a/sljit/sljitConfigInternal.h +++ b/sljit/sljitConfigInternal.h @@ -308,7 +308,7 @@ typedef double sljit_d; /* ABI (Application Binary Interface) types. */ #if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) -#if defined(__GNUC__) +#if defined(__GNUC__) && !defined(__APPLE__) #define SLJIT_CALL __attribute__ ((fastcall)) #define SLJIT_X86_32_FASTCALL 1 diff --git a/sljit/sljitNativeX86_32.c b/sljit/sljitNativeX86_32.c index 03a595b..2866e8f 100644 --- a/sljit/sljitNativeX86_32.c +++ b/sljit/sljitNativeX86_32.c @@ -149,7 +149,12 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_enter(struct sljit_compiler *compil if (saveds > 3) locals_offset += (saveds - 3) * sizeof(sljit_uw); compiler->locals_offset = locals_offset; +#if defined(__APPLE__) + saveds = (2 + (saveds <= 3 ? saveds : 3)) * sizeof(sljit_uw); + local_size = ((locals_offset + saveds + local_size + 15) & ~15) - saveds; +#else local_size = locals_offset + ((local_size + sizeof(sljit_uw) - 1) & ~(sizeof(sljit_uw) - 1)); +#endif compiler->local_size = local_size; #ifdef _WIN32 @@ -197,7 +202,12 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_set_context(struct sljit_compiler *compiler, if (saveds > 3) locals_offset += (saveds - 3) * sizeof(sljit_uw); compiler->locals_offset = locals_offset; +#if defined(__APPLE__) + saveds = (2 + (saveds <= 3 ? saveds : 3)) * sizeof(sljit_uw); + compiler->local_size = ((locals_offset + saveds + local_size + 15) & ~15) - saveds; +#else compiler->local_size = locals_offset + ((local_size + sizeof(sljit_uw) - 1) & ~(sizeof(sljit_uw) - 1)); +#endif } SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_return(struct sljit_compiler *compiler, sljit_si op, sljit_si src, sljit_sw srcw) |