summaryrefslogtreecommitdiff
path: root/src/lj_asm.c
diff options
context:
space:
mode:
authorMike Pall <mike>2016-05-23 00:34:05 +0200
committerMike Pall <mike>2016-05-23 00:34:05 +0200
commitf26679c7195e99b32f95ea9f25b47b9981e15d3d (patch)
treed50e967a387b1a9853b83b464cf819eb3607b533 /src/lj_asm.c
parent9e99ccc360bc9784ebe5ce29d5fa2c72acfc5777 (diff)
downloadluajit-f26679c7195e99b32f95ea9f25b47b9981e15d3d.tar.gz
luajit-f26679c7195e99b32f95ea9f25b47b9981e15d3d.tar.bz2
luajit-f26679c7195e99b32f95ea9f25b47b9981e15d3d.zip
LJ_GC64: Add support for 64 bit GCobj constants in the IR.
Contributed by Peter Cawley.
Diffstat (limited to 'src/lj_asm.c')
-rw-r--r--src/lj_asm.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/lj_asm.c b/src/lj_asm.c
index 0b3e770a..9f784cc8 100644
--- a/src/lj_asm.c
+++ b/src/lj_asm.c
@@ -704,6 +704,11 @@ static void ra_left(ASMState *as, Reg dest, IRRef lref)
704 } else if (ir->o == IR_KINT64) { 704 } else if (ir->o == IR_KINT64) {
705 emit_loadk64(as, dest, ir); 705 emit_loadk64(as, dest, ir);
706 return; 706 return;
707#if LJ_GC64
708 } else if (ir->o == IR_KGC || ir->o == IR_KPTR || ir->o == IR_KKPTR) {
709 emit_loadk64(as, dest, ir);
710 return;
711#endif
707#endif 712#endif
708 } else if (ir->o != IR_KPRI) { 713 } else if (ir->o != IR_KPRI) {
709 lua_assert(ir->o == IR_KINT || ir->o == IR_KGC || 714 lua_assert(ir->o == IR_KINT || ir->o == IR_KGC ||
@@ -1933,7 +1938,7 @@ static void asm_tail_link(ASMState *as)
1933 emit_addptr(as, RID_BASE, 8*(int32_t)baseslot); 1938 emit_addptr(as, RID_BASE, 8*(int32_t)baseslot);
1934 1939
1935 if (as->J->ktrace) { /* Patch ktrace slot with the final GCtrace pointer. */ 1940 if (as->J->ktrace) { /* Patch ktrace slot with the final GCtrace pointer. */
1936 setgcref(IR(as->J->ktrace)->gcr, obj2gco(as->J->curfinal)); 1941 setgcref(IR(as->J->ktrace)[LJ_GC64].gcr, obj2gco(as->J->curfinal));
1937 IR(as->J->ktrace)->o = IR_KGC; 1942 IR(as->J->ktrace)->o = IR_KGC;
1938 } 1943 }
1939 1944
@@ -1965,8 +1970,12 @@ static void asm_setup_regsp(ASMState *as)
1965 for (ir = IR(T->nk), lastir = IR(REF_BASE); ir < lastir; ir++) { 1970 for (ir = IR(T->nk), lastir = IR(REF_BASE); ir < lastir; ir++) {
1966 ir->prev = REGSP_INIT; 1971 ir->prev = REGSP_INIT;
1967 if (irt_is64(ir->t) && ir->o != IR_KNULL) { 1972 if (irt_is64(ir->t) && ir->o != IR_KNULL) {
1973#if LJ_GC64
1974 ir->i = 0; /* Will become non-zero only for RIP-relative addresses. */
1975#else
1968 /* Make life easier for backends by putting address of constant in i. */ 1976 /* Make life easier for backends by putting address of constant in i. */
1969 ir->i = (int32_t)(intptr_t)(ir+1); 1977 ir->i = (int32_t)(intptr_t)(ir+1);
1978#endif
1970 ir++; 1979 ir++;
1971 } 1980 }
1972 } 1981 }