Revision: 967
http://vcs.pcre.org/viewvc?view=rev&revision=967
Author: zherczeg
Date: 2012-05-14 08:36:39 +0100 (Mon, 14 May 2012)
Log Message:
-----------
cache flush for Apple devices
Modified Paths:
--------------
code/trunk/ChangeLog
code/trunk/sljit/sljitConfigInternal.h
Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog 2012-05-14 06:27:21 UTC (rev 966)
+++ code/trunk/ChangeLog 2012-05-14 07:36:39 UTC (rev 967)
@@ -113,7 +113,10 @@
30. JIT compiler update.
+31. JIT is now supported on jailbroken iOS devices. Thanks for Ruiger
+ Rill for the patch.
+
Version 8.30 04-February-2012
-----------------------------
Modified: code/trunk/sljit/sljitConfigInternal.h
===================================================================
--- code/trunk/sljit/sljitConfigInternal.h 2012-05-14 06:27:21 UTC (rev 966)
+++ code/trunk/sljit/sljitConfigInternal.h 2012-05-14 07:36:39 UTC (rev 967)
@@ -194,17 +194,26 @@
#ifndef SLJIT_CACHE_FLUSH
-#if (defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32) || (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64)
+#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) || (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
+/* Not required to implement on archs with unified caches. */
+#define SLJIT_CACHE_FLUSH(from, to)
+
+#elif defined __APPLE__
+
+/* Supported by all macs since Mac OS 10.5.
+ However, it does not work on non-jailbroken iOS devices,
+ although the compilation is successful. */
+
+#define SLJIT_CACHE_FLUSH(from, to) \
+ sys_icache_invalidate((char*)(from), (char*)(to) - (char*)(from))
+
+#elif (defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32) || (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64)
+
/* The __clear_cache() implementation of GCC is a dummy function on PowerPC. */
#define SLJIT_CACHE_FLUSH(from, to) \
ppc_cache_flush((from), (to))
-#elif (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) || (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
-
-/* Not required to implement on archs with unified caches. */
-#define SLJIT_CACHE_FLUSH(from, to)
-
#else
/* Calls __ARM_NR_cacheflush on ARM-Linux. */