diff options
author | Mike Pall <mike> | 2021-09-19 16:09:48 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2021-09-19 16:09:48 +0200 |
commit | f2d333c1ac0f33fe5a7386d4e66f0f6c57c2616e (patch) | |
tree | 5864c58bf82417de940bcce64767d1212fdcb429 /src | |
parent | 8ff09d9f5ad5b037926be2a50dc32b681c5e7597 (diff) | |
download | luajit-f2d333c1ac0f33fe5a7386d4e66f0f6c57c2616e.tar.gz luajit-f2d333c1ac0f33fe5a7386d4e66f0f6c57c2616e.tar.bz2 luajit-f2d333c1ac0f33fe5a7386d4e66f0f6c57c2616e.zip |
MIPS: Fix trace linking.
Diffstat (limited to 'src')
-rw-r--r-- | src/lj_asm.c | 4 | ||||
-rw-r--r-- | src/lj_asm_arm.h | 6 | ||||
-rw-r--r-- | src/lj_asm_arm64.h | 6 | ||||
-rw-r--r-- | src/lj_asm_mips.h | 8 | ||||
-rw-r--r-- | src/lj_asm_ppc.h | 6 | ||||
-rw-r--r-- | src/lj_asm_x86.h | 6 |
6 files changed, 33 insertions, 3 deletions
diff --git a/src/lj_asm.c b/src/lj_asm.c index b0e6d313..1ecbe45e 100644 --- a/src/lj_asm.c +++ b/src/lj_asm.c | |||
@@ -2550,7 +2550,9 @@ void lj_asm_trace(jit_State *J, GCtrace *T) | |||
2550 | /* Set trace entry point before fixing up tail to allow link to self. */ | 2550 | /* Set trace entry point before fixing up tail to allow link to self. */ |
2551 | T->mcode = as->mcp; | 2551 | T->mcode = as->mcp; |
2552 | T->mcloop = as->mcloop ? (MSize)((char *)as->mcloop - (char *)as->mcp) : 0; | 2552 | T->mcloop = as->mcloop ? (MSize)((char *)as->mcloop - (char *)as->mcp) : 0; |
2553 | if (!as->loopref) | 2553 | if (as->loopref) |
2554 | asm_loop_tail_fixup(as); | ||
2555 | else | ||
2554 | asm_tail_fixup(as, T->link); /* Note: this may change as->mctop! */ | 2556 | asm_tail_fixup(as, T->link); /* Note: this may change as->mctop! */ |
2555 | T->szmcode = (MSize)((char *)as->mctop - (char *)as->mcp); | 2557 | T->szmcode = (MSize)((char *)as->mctop - (char *)as->mcp); |
2556 | asm_snap_fixup_mcofs(as); | 2558 | asm_snap_fixup_mcofs(as); |
diff --git a/src/lj_asm_arm.h b/src/lj_asm_arm.h index 96703d7d..6cfe5c70 100644 --- a/src/lj_asm_arm.h +++ b/src/lj_asm_arm.h | |||
@@ -2129,6 +2129,12 @@ static void asm_loop_fixup(ASMState *as) | |||
2129 | } | 2129 | } |
2130 | } | 2130 | } |
2131 | 2131 | ||
2132 | /* Fixup the tail of the loop. */ | ||
2133 | static void asm_loop_tail_fixup(ASMState *as) | ||
2134 | { | ||
2135 | UNUSED(as); /* Nothing to do. */ | ||
2136 | } | ||
2137 | |||
2132 | /* -- Head of trace ------------------------------------------------------- */ | 2138 | /* -- Head of trace ------------------------------------------------------- */ |
2133 | 2139 | ||
2134 | /* Reload L register from g->cur_L. */ | 2140 | /* Reload L register from g->cur_L. */ |
diff --git a/src/lj_asm_arm64.h b/src/lj_asm_arm64.h index dde52347..bb972ad1 100644 --- a/src/lj_asm_arm64.h +++ b/src/lj_asm_arm64.h | |||
@@ -1858,6 +1858,12 @@ static void asm_loop_fixup(ASMState *as) | |||
1858 | } | 1858 | } |
1859 | } | 1859 | } |
1860 | 1860 | ||
1861 | /* Fixup the tail of the loop. */ | ||
1862 | static void asm_loop_tail_fixup(ASMState *as) | ||
1863 | { | ||
1864 | UNUSED(as); /* Nothing to do. */ | ||
1865 | } | ||
1866 | |||
1861 | /* -- Head of trace ------------------------------------------------------- */ | 1867 | /* -- Head of trace ------------------------------------------------------- */ |
1862 | 1868 | ||
1863 | /* Reload L register from g->cur_L. */ | 1869 | /* Reload L register from g->cur_L. */ |
diff --git a/src/lj_asm_mips.h b/src/lj_asm_mips.h index 22aa88bf..1fe934e1 100644 --- a/src/lj_asm_mips.h +++ b/src/lj_asm_mips.h | |||
@@ -2640,6 +2640,12 @@ static void asm_loop_fixup(ASMState *as) | |||
2640 | } | 2640 | } |
2641 | } | 2641 | } |
2642 | 2642 | ||
2643 | /* Fixup the tail of the loop. */ | ||
2644 | static void asm_loop_tail_fixup(ASMState *as) | ||
2645 | { | ||
2646 | if (as->loopinv) as->mctop--; | ||
2647 | } | ||
2648 | |||
2643 | /* -- Head of trace ------------------------------------------------------- */ | 2649 | /* -- Head of trace ------------------------------------------------------- */ |
2644 | 2650 | ||
2645 | /* Coalesce BASE register for a root trace. */ | 2651 | /* Coalesce BASE register for a root trace. */ |
@@ -2647,7 +2653,6 @@ static void asm_head_root_base(ASMState *as) | |||
2647 | { | 2653 | { |
2648 | IRIns *ir = IR(REF_BASE); | 2654 | IRIns *ir = IR(REF_BASE); |
2649 | Reg r = ir->r; | 2655 | Reg r = ir->r; |
2650 | if (as->loopinv) as->mctop--; | ||
2651 | if (ra_hasreg(r)) { | 2656 | if (ra_hasreg(r)) { |
2652 | ra_free(as, r); | 2657 | ra_free(as, r); |
2653 | if (rset_test(as->modset, r) || irt_ismarked(ir->t)) | 2658 | if (rset_test(as->modset, r) || irt_ismarked(ir->t)) |
@@ -2662,7 +2667,6 @@ static RegSet asm_head_side_base(ASMState *as, IRIns *irp, RegSet allow) | |||
2662 | { | 2667 | { |
2663 | IRIns *ir = IR(REF_BASE); | 2668 | IRIns *ir = IR(REF_BASE); |
2664 | Reg r = ir->r; | 2669 | Reg r = ir->r; |
2665 | if (as->loopinv) as->mctop--; | ||
2666 | if (ra_hasreg(r)) { | 2670 | if (ra_hasreg(r)) { |
2667 | ra_free(as, r); | 2671 | ra_free(as, r); |
2668 | if (rset_test(as->modset, r) || irt_ismarked(ir->t)) | 2672 | if (rset_test(as->modset, r) || irt_ismarked(ir->t)) |
diff --git a/src/lj_asm_ppc.h b/src/lj_asm_ppc.h index c27ee71c..f5cedd6a 100644 --- a/src/lj_asm_ppc.h +++ b/src/lj_asm_ppc.h | |||
@@ -2157,6 +2157,12 @@ static void asm_loop_fixup(ASMState *as) | |||
2157 | } | 2157 | } |
2158 | } | 2158 | } |
2159 | 2159 | ||
2160 | /* Fixup the tail of the loop. */ | ||
2161 | static void asm_loop_tail_fixup(ASMState *as) | ||
2162 | { | ||
2163 | UNUSED(as); /* Nothing to do. */ | ||
2164 | } | ||
2165 | |||
2160 | /* -- Head of trace ------------------------------------------------------- */ | 2166 | /* -- Head of trace ------------------------------------------------------- */ |
2161 | 2167 | ||
2162 | /* Coalesce BASE register for a root trace. */ | 2168 | /* Coalesce BASE register for a root trace. */ |
diff --git a/src/lj_asm_x86.h b/src/lj_asm_x86.h index c8ed46d2..3c934c31 100644 --- a/src/lj_asm_x86.h +++ b/src/lj_asm_x86.h | |||
@@ -2863,6 +2863,12 @@ static void asm_loop_fixup(ASMState *as) | |||
2863 | } | 2863 | } |
2864 | } | 2864 | } |
2865 | 2865 | ||
2866 | /* Fixup the tail of the loop. */ | ||
2867 | static void asm_loop_tail_fixup(ASMState *as) | ||
2868 | { | ||
2869 | UNUSED(as); /* Nothing to do. */ | ||
2870 | } | ||
2871 | |||
2866 | /* -- Head of trace ------------------------------------------------------- */ | 2872 | /* -- Head of trace ------------------------------------------------------- */ |
2867 | 2873 | ||
2868 | /* Coalesce BASE register for a root trace. */ | 2874 | /* Coalesce BASE register for a root trace. */ |