aboutsummaryrefslogtreecommitdiff
path: root/src/lj_asm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_asm.c')
-rw-r--r--src/lj_asm.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lj_asm.c b/src/lj_asm.c
index b3fa7739..adb5a9ce 100644
--- a/src/lj_asm.c
+++ b/src/lj_asm.c
@@ -859,19 +859,23 @@ static uint32_t ir_khash(IRIns *ir)
859 return hashrot(lo, hi); 859 return hashrot(lo, hi);
860} 860}
861 861
862#if !LJ_TARGET_X86ORX64 && LJ_TARGET_OSX
863void sys_icache_invalidate(void *start, size_t len);
864#endif
865
862/* Flush instruction cache. */ 866/* Flush instruction cache. */
863static void asm_cache_flush(MCode *start, MCode *end) 867static void asm_cache_flush(MCode *start, MCode *end)
864{ 868{
865 VG_INVALIDATE(start, (char *)end-(char *)start); 869 VG_INVALIDATE(start, (char *)end-(char *)start);
866#if LJ_TARGET_X86ORX64 870#if LJ_TARGET_X86ORX64
867 UNUSED(start); UNUSED(end); 871 UNUSED(start); UNUSED(end);
868#else 872#elif LJ_TARGET_OSX
869#if defined(__GNUC__) 873 sys_icache_invalidate(start, end-start);
874#elif defined(__GNUC__)
870 __clear_cache(start, end); 875 __clear_cache(start, end);
871#else 876#else
872#error "Missing builtin to flush instruction cache" 877#error "Missing builtin to flush instruction cache"
873#endif 878#endif
874#endif
875} 879}
876 880
877/* -- Allocations --------------------------------------------------------- */ 881/* -- Allocations --------------------------------------------------------- */