Revision: 1250
http://vcs.pcre.org/viewvc?view=rev&revision=1250
Author: zherczeg
Date: 2013-02-20 09:59:29 +0000 (Wed, 20 Feb 2013)
Log Message:
-----------
JIT compiler now supports 32 bit Macs thanks to Lawrence Velazquez.
Modified Paths:
--------------
code/trunk/ChangeLog
code/trunk/sljit/sljitConfigInternal.h
code/trunk/sljit/sljitNativeX86_32.c
Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog 2013-02-18 09:55:43 UTC (rev 1249)
+++ code/trunk/ChangeLog 2013-02-20 09:59:29 UTC (rev 1250)
@@ -58,7 +58,9 @@
14. Inlining subpatterns in recursions, when certain conditions are fulfilled.
Only supported by the JIT compiler at the moment.
+15. JIT compiler now supports 32 bit Macs thanks to Lawrence Velazquez.
+
Version 8.32 30-November-2012
-----------------------------
Modified: code/trunk/sljit/sljitConfigInternal.h
===================================================================
--- code/trunk/sljit/sljitConfigInternal.h 2013-02-18 09:55:43 UTC (rev 1249)
+++ code/trunk/sljit/sljitConfigInternal.h 2013-02-20 09:59:29 UTC (rev 1250)
@@ -308,7 +308,7 @@
/* 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
Modified: code/trunk/sljit/sljitNativeX86_32.c
===================================================================
--- code/trunk/sljit/sljitNativeX86_32.c 2013-02-18 09:55:43 UTC (rev 1249)
+++ code/trunk/sljit/sljitNativeX86_32.c 2013-02-20 09:59:29 UTC (rev 1250)
@@ -149,7 +149,12 @@
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 @@
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)