aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pall <mike>2011-05-17 21:26:00 +0200
committerMike Pall <mike>2011-05-17 21:26:00 +0200
commit3a942d6ceaf409874906408edc3e47de20157198 (patch)
treea3178dad2c89fa66adf4f8b3fc4033fb10f39c1c
parent3168d9aa5983c2dbdc4c8a26a9e0a4b23fb2d178 (diff)
downloadluajit-3a942d6ceaf409874906408edc3e47de20157198.tar.gz
luajit-3a942d6ceaf409874906408edc3e47de20157198.tar.bz2
luajit-3a942d6ceaf409874906408edc3e47de20157198.zip
Portability cleanups for assembler backend.
-rw-r--r--src/lj_asm.c6
-rw-r--r--src/lj_emit_x86.h5
-rw-r--r--src/lj_target_x86.h4
3 files changed, 8 insertions, 7 deletions
diff --git a/src/lj_asm.c b/src/lj_asm.c
index 37b7e3f5..e2c14872 100644
--- a/src/lj_asm.c
+++ b/src/lj_asm.c
@@ -987,7 +987,7 @@ static void asm_head_root(ASMState *as)
987{ 987{
988 int32_t spadj; 988 int32_t spadj;
989 asm_head_root_base(as); 989 asm_head_root_base(as);
990 emit_setgli(as, vmstate, (int32_t)as->T->traceno); 990 emit_setvmstate(as, (int32_t)as->T->traceno);
991 spadj = asm_stack_adjust(as); 991 spadj = asm_stack_adjust(as);
992 as->T->spadjust = (uint16_t)spadj; 992 as->T->spadjust = (uint16_t)spadj;
993 emit_spsub(as, spadj); 993 emit_spsub(as, spadj);
@@ -1082,7 +1082,7 @@ static void asm_head_side(ASMState *as)
1082 } 1082 }
1083 1083
1084 /* Store trace number and adjust stack frame relative to the parent. */ 1084 /* Store trace number and adjust stack frame relative to the parent. */
1085 emit_setgli(as, vmstate, (int32_t)as->T->traceno); 1085 emit_setvmstate(as, (int32_t)as->T->traceno);
1086 emit_spsub(as, spdelta); 1086 emit_spsub(as, spdelta);
1087 1087
1088 /* Restore target registers from parent spill slots. */ 1088 /* Restore target registers from parent spill slots. */
@@ -1169,7 +1169,7 @@ static void asm_tail_link(ASMState *as)
1169 pc = retpc; 1169 pc = retpc;
1170 } 1170 }
1171 emit_loada(as, RID_DISPATCH, J2GG(as->J)->dispatch); 1171 emit_loada(as, RID_DISPATCH, J2GG(as->J)->dispatch);
1172 emit_loada(as, RID_PC, pc); 1172 emit_loada(as, RID_LPC, pc);
1173 mres = (int32_t)(snap->nslots - baseslot); 1173 mres = (int32_t)(snap->nslots - baseslot);
1174 switch (bc_op(*pc)) { 1174 switch (bc_op(*pc)) {
1175 case BC_CALLM: case BC_CALLMT: 1175 case BC_CALLM: case BC_CALLMT:
diff --git a/src/lj_emit_x86.h b/src/lj_emit_x86.h
index c781e3d3..6c06184d 100644
--- a/src/lj_emit_x86.h
+++ b/src/lj_emit_x86.h
@@ -261,8 +261,9 @@ static void emit_movmroi(ASMState *as, Reg base, int32_t ofs, int32_t i)
261 emit_rma(as, (xo), (r), (void *)&J2G(as->J)->field) 261 emit_rma(as, (xo), (r), (void *)&J2G(as->J)->field)
262#define emit_getgl(as, r, field) emit_opgl(as, XO_MOV, (r), field) 262#define emit_getgl(as, r, field) emit_opgl(as, XO_MOV, (r), field)
263#define emit_setgl(as, r, field) emit_opgl(as, XO_MOVto, (r), field) 263#define emit_setgl(as, r, field) emit_opgl(as, XO_MOVto, (r), field)
264#define emit_setgli(as, field, i) \ 264
265 (emit_i32(as, i), emit_opgl(as, XO_MOVmi, 0, field)) 265#define emit_setvmstate(as, i) \
266 (emit_i32(as, i), emit_opgl(as, XO_MOVmi, 0, vmstate))
266 267
267/* mov r, i / xor r, r */ 268/* mov r, i / xor r, r */
268static void emit_loadi(ASMState *as, Reg r, int32_t i) 269static void emit_loadi(ASMState *as, Reg r, int32_t i)
diff --git a/src/lj_target_x86.h b/src/lj_target_x86.h
index fd2a32fe..34b247d4 100644
--- a/src/lj_target_x86.h
+++ b/src/lj_target_x86.h
@@ -43,10 +43,10 @@ enum {
43 /* These definitions must match with the *.dasc file(s): */ 43 /* These definitions must match with the *.dasc file(s): */
44 RID_BASE = RID_EDX, /* Interpreter BASE. */ 44 RID_BASE = RID_EDX, /* Interpreter BASE. */
45#if LJ_64 && !LJ_ABI_WIN 45#if LJ_64 && !LJ_ABI_WIN
46 RID_PC = RID_EBX, /* Interpreter PC. */ 46 RID_LPC = RID_EBX, /* Interpreter PC. */
47 RID_DISPATCH = RID_R14D, /* Interpreter DISPATCH table. */ 47 RID_DISPATCH = RID_R14D, /* Interpreter DISPATCH table. */
48#else 48#else
49 RID_PC = RID_ESI, /* Interpreter PC. */ 49 RID_LPC = RID_ESI, /* Interpreter PC. */
50 RID_DISPATCH = RID_EBX, /* Interpreter DISPATCH table. */ 50 RID_DISPATCH = RID_EBX, /* Interpreter DISPATCH table. */
51#endif 51#endif
52 52