mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-08 07:34:07 +00:00
Make sure to flush/sync the D/I-cache for all generated code.
This commit is contained in:
parent
32098921fd
commit
8fc9bc1724
@ -1652,6 +1652,7 @@ void lj_asm_trace(jit_State *J, GCtrace *T)
|
|||||||
{
|
{
|
||||||
ASMState as_;
|
ASMState as_;
|
||||||
ASMState *as = &as_;
|
ASMState *as = &as_;
|
||||||
|
MCode *origtop;
|
||||||
|
|
||||||
/* Ensure an initialized instruction beyond the last one for HIOP checks. */
|
/* Ensure an initialized instruction beyond the last one for HIOP checks. */
|
||||||
J->cur.nins = lj_ir_nextins(J);
|
J->cur.nins = lj_ir_nextins(J);
|
||||||
@ -1674,7 +1675,8 @@ void lj_asm_trace(jit_State *J, GCtrace *T)
|
|||||||
} else {
|
} else {
|
||||||
as->parent = NULL;
|
as->parent = NULL;
|
||||||
}
|
}
|
||||||
as->mctop = lj_mcode_reserve(J, &as->mcbot); /* Reserve MCode memory. */
|
/* Reserve MCode memory. */
|
||||||
|
as->mctop = origtop = lj_mcode_reserve(J, &as->mcbot);
|
||||||
as->mcp = as->mctop;
|
as->mcp = as->mctop;
|
||||||
as->mclim = as->mcbot + MCLIM_REDZONE;
|
as->mclim = as->mcbot + MCLIM_REDZONE;
|
||||||
asm_setup_target(as);
|
asm_setup_target(as);
|
||||||
@ -1737,7 +1739,7 @@ void lj_asm_trace(jit_State *J, GCtrace *T)
|
|||||||
if (!as->loopref)
|
if (!as->loopref)
|
||||||
asm_tail_fixup(as, T->link); /* Note: this may change as->mctop! */
|
asm_tail_fixup(as, T->link); /* Note: this may change as->mctop! */
|
||||||
T->szmcode = (MSize)((char *)as->mctop - (char *)as->mcp);
|
T->szmcode = (MSize)((char *)as->mctop - (char *)as->mcp);
|
||||||
asm_cache_flush(T->mcode, as->mctop);
|
asm_cache_flush(T->mcode, origtop);
|
||||||
}
|
}
|
||||||
|
|
||||||
#undef IR
|
#undef IR
|
||||||
|
Loading…
Reference in New Issue
Block a user