diff options
author | Mike Pall <mike> | 2011-05-26 18:04:01 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2011-05-26 18:04:01 +0200 |
commit | 8d4400331d4df7d53a80de6f466e6c7ee3ca9380 (patch) | |
tree | f96f66b2c4080b7156c488b0ce2c9d29e8a27b4b /src | |
parent | 4057620bf5bcbb1ca96a6c0ffd83fa9e8a23efc8 (diff) | |
download | luajit-8d4400331d4df7d53a80de6f466e6c7ee3ca9380.tar.gz luajit-8d4400331d4df7d53a80de6f466e6c7ee3ca9380.tar.bz2 luajit-8d4400331d4df7d53a80de6f466e6c7ee3ca9380.zip |
ARM: Flush instruction cache in assembler backend.
Diffstat (limited to 'src')
-rw-r--r-- | src/lj_asm.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/lj_asm.c b/src/lj_asm.c index e028ab4f..640b6e15 100644 --- a/src/lj_asm.c +++ b/src/lj_asm.c | |||
@@ -852,6 +852,19 @@ static uint32_t ir_khash(IRIns *ir) | |||
852 | return hashrot(lo, hi); | 852 | return hashrot(lo, hi); |
853 | } | 853 | } |
854 | 854 | ||
855 | /* Flush instruction cache. */ | ||
856 | static void asm_cache_flush(MCode *start, MCode *end) | ||
857 | { | ||
858 | VG_INVALIDATE(start, (char *)end-(char *)start); | ||
859 | #if !LJ_TARGET_X86ORX64 | ||
860 | #if defined(__GNUC__) | ||
861 | __clear_cache(start, end); | ||
862 | #else | ||
863 | #error "Missing builtin to flush instruction cache" | ||
864 | #endif | ||
865 | #endif | ||
866 | } | ||
867 | |||
855 | /* -- Allocations --------------------------------------------------------- */ | 868 | /* -- Allocations --------------------------------------------------------- */ |
856 | 869 | ||
857 | static void asm_gencall(ASMState *as, const CCallInfo *ci, IRRef *args); | 870 | static void asm_gencall(ASMState *as, const CCallInfo *ci, IRRef *args); |
@@ -1620,7 +1633,7 @@ void lj_asm_trace(jit_State *J, GCtrace *T) | |||
1620 | if (!as->loopref) | 1633 | if (!as->loopref) |
1621 | asm_tail_fixup(as, T->link); /* Note: this may change as->mctop! */ | 1634 | asm_tail_fixup(as, T->link); /* Note: this may change as->mctop! */ |
1622 | T->szmcode = (MSize)((char *)as->mctop - (char *)as->mcp); | 1635 | T->szmcode = (MSize)((char *)as->mctop - (char *)as->mcp); |
1623 | VG_INVALIDATE(T->mcode, T->szmcode); | 1636 | asm_cache_flush(T->mcode, as->mctop); |
1624 | } | 1637 | } |
1625 | 1638 | ||
1626 | #undef IR | 1639 | #undef IR |