summaryrefslogtreecommitdiff
path: root/src/lj_asm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_asm.c')
-rw-r--r--src/lj_asm.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lj_asm.c b/src/lj_asm.c
index b57cf118..5c564748 100644
--- a/src/lj_asm.c
+++ b/src/lj_asm.c
@@ -67,8 +67,8 @@ typedef struct ASMState {
67 BCReg topslot; /* Number of slots for stack check (unless 0). */ 67 BCReg topslot; /* Number of slots for stack check (unless 0). */
68 MSize gcsteps; /* Accumulated number of GC steps (per section). */ 68 MSize gcsteps; /* Accumulated number of GC steps (per section). */
69 69
70 Trace *T; /* Trace to assemble. */ 70 GCtrace *T; /* Trace to assemble. */
71 Trace *parent; /* Parent trace (or NULL). */ 71 GCtrace *parent; /* Parent trace (or NULL). */
72 72
73 MCode *mcbot; /* Bottom of reserved MCode. */ 73 MCode *mcbot; /* Bottom of reserved MCode. */
74 MCode *mctop; /* Top of generated MCode. */ 74 MCode *mctop; /* Top of generated MCode. */
@@ -3228,7 +3228,7 @@ static void asm_tail_link(ASMState *as)
3228 const BCIns *pc = snap_pc(as->T->snapmap[snap->mapofs + snap->nent]); 3228 const BCIns *pc = snap_pc(as->T->snapmap[snap->mapofs + snap->nent]);
3229 int32_t mres; 3229 int32_t mres;
3230 if (bc_op(*pc) == BC_JLOOP) { /* NYI: find a better way to do this. */ 3230 if (bc_op(*pc) == BC_JLOOP) { /* NYI: find a better way to do this. */
3231 BCIns *retpc = &as->J->trace[bc_d(*pc)]->startins; 3231 BCIns *retpc = &traceref(as->J, bc_d(*pc))->startins;
3232 if (bc_isret(bc_op(*retpc))) 3232 if (bc_isret(bc_op(*retpc)))
3233 pc = retpc; 3233 pc = retpc;
3234 } 3234 }
@@ -3294,7 +3294,7 @@ static void asm_tail_fixup(ASMState *as, TraceNo lnk)
3294 } 3294 }
3295 /* Patch exit branch. */ 3295 /* Patch exit branch. */
3296 target = lnk == TRACE_INTERP ? (MCode *)lj_vm_exit_interp : 3296 target = lnk == TRACE_INTERP ? (MCode *)lj_vm_exit_interp :
3297 as->J->trace[lnk]->mcode; 3297 traceref(as->J, lnk)->mcode;
3298 *(int32_t *)(p-4) = jmprel(p, target); 3298 *(int32_t *)(p-4) = jmprel(p, target);
3299 p[-5] = XI_JMP; 3299 p[-5] = XI_JMP;
3300 /* Drop unused mcode tail. Fill with NOPs to make the prefetcher happy. */ 3300 /* Drop unused mcode tail. Fill with NOPs to make the prefetcher happy. */
@@ -3437,7 +3437,7 @@ static void asm_trace(ASMState *as)
3437/* -- Trace setup --------------------------------------------------------- */ 3437/* -- Trace setup --------------------------------------------------------- */
3438 3438
3439/* Clear reg/sp for all instructions and add register hints. */ 3439/* Clear reg/sp for all instructions and add register hints. */
3440static void asm_setup_regsp(ASMState *as, Trace *T) 3440static void asm_setup_regsp(ASMState *as, GCtrace *T)
3441{ 3441{
3442 IRRef i, nins; 3442 IRRef i, nins;
3443 int inloop; 3443 int inloop;
@@ -3577,7 +3577,7 @@ static void asm_setup_regsp(ASMState *as, Trace *T)
3577#endif 3577#endif
3578 3578
3579/* Assemble a trace. */ 3579/* Assemble a trace. */
3580void lj_asm_trace(jit_State *J, Trace *T) 3580void lj_asm_trace(jit_State *J, GCtrace *T)
3581{ 3581{
3582 ASMState as_; 3582 ASMState as_;
3583 ASMState *as = &as_; 3583 ASMState *as = &as_;
@@ -3591,7 +3591,7 @@ void lj_asm_trace(jit_State *J, Trace *T)
3591 as->realign = NULL; 3591 as->realign = NULL;
3592 as->loopinv = 0; 3592 as->loopinv = 0;
3593 if (J->parent) { 3593 if (J->parent) {
3594 as->parent = J->trace[J->parent]; 3594 as->parent = traceref(J, J->parent);
3595 lj_snap_regspmap(as->parentmap, as->parent, J->exitno); 3595 lj_snap_regspmap(as->parentmap, as->parent, J->exitno);
3596 } else { 3596 } else {
3597 as->parent = NULL; 3597 as->parent = NULL;
@@ -3667,7 +3667,7 @@ void lj_asm_trace(jit_State *J, Trace *T)
3667} 3667}
3668 3668
3669/* Patch exit jumps of existing machine code to a new target. */ 3669/* Patch exit jumps of existing machine code to a new target. */
3670void lj_asm_patchexit(jit_State *J, Trace *T, ExitNo exitno, MCode *target) 3670void lj_asm_patchexit(jit_State *J, GCtrace *T, ExitNo exitno, MCode *target)
3671{ 3671{
3672 MCode *p = T->mcode; 3672 MCode *p = T->mcode;
3673 MCode *mcarea = lj_mcode_patch(J, p, 0); 3673 MCode *mcarea = lj_mcode_patch(J, p, 0);