mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
LJ_GC64: Make ASMREF_L references 64 bit.
Reported by Yichun Zhang.
This commit is contained in:
parent
b4ed3219a1
commit
850f8c59d3
@ -2015,6 +2015,7 @@ static void asm_setup_regsp(ASMState *as)
|
|||||||
ir->prev = REGSP_INIT;
|
ir->prev = REGSP_INIT;
|
||||||
if (irt_is64(ir->t) && ir->o != IR_KNULL) {
|
if (irt_is64(ir->t) && ir->o != IR_KNULL) {
|
||||||
#if LJ_GC64
|
#if LJ_GC64
|
||||||
|
/* The false-positive of irt_is64() for ASMREF_L (REF_NIL) is OK here. */
|
||||||
ir->i = 0; /* Will become non-zero only for RIP-relative addresses. */
|
ir->i = 0; /* Will become non-zero only for RIP-relative addresses. */
|
||||||
#else
|
#else
|
||||||
/* Make life easier for backends by putting address of constant in i. */
|
/* Make life easier for backends by putting address of constant in i. */
|
||||||
|
@ -377,10 +377,12 @@ typedef struct IRType1 { uint8_t irt; } IRType1;
|
|||||||
#define irt_isint64(t) (irt_typerange((t), IRT_I64, IRT_U64))
|
#define irt_isint64(t) (irt_typerange((t), IRT_I64, IRT_U64))
|
||||||
|
|
||||||
#if LJ_GC64
|
#if LJ_GC64
|
||||||
|
/* Include IRT_NIL, so IR(ASMREF_L) (aka REF_NIL) is considered 64 bit. */
|
||||||
#define IRT_IS64 \
|
#define IRT_IS64 \
|
||||||
((1u<<IRT_NUM)|(1u<<IRT_I64)|(1u<<IRT_U64)|(1u<<IRT_P64)|\
|
((1u<<IRT_NUM)|(1u<<IRT_I64)|(1u<<IRT_U64)|(1u<<IRT_P64)|\
|
||||||
(1u<<IRT_LIGHTUD)|(1u<<IRT_STR)|(1u<<IRT_THREAD)|(1u<<IRT_PROTO)|\
|
(1u<<IRT_LIGHTUD)|(1u<<IRT_STR)|(1u<<IRT_THREAD)|(1u<<IRT_PROTO)|\
|
||||||
(1u<<IRT_FUNC)|(1u<<IRT_CDATA)|(1u<<IRT_TAB)|(1u<<IRT_UDATA))
|
(1u<<IRT_FUNC)|(1u<<IRT_CDATA)|(1u<<IRT_TAB)|(1u<<IRT_UDATA)|\
|
||||||
|
(1u<<IRT_NIL))
|
||||||
#elif LJ_64
|
#elif LJ_64
|
||||||
#define IRT_IS64 \
|
#define IRT_IS64 \
|
||||||
((1u<<IRT_NUM)|(1u<<IRT_I64)|(1u<<IRT_U64)|(1u<<IRT_P64)|(1u<<IRT_LIGHTUD))
|
((1u<<IRT_NUM)|(1u<<IRT_I64)|(1u<<IRT_U64)|(1u<<IRT_P64)|(1u<<IRT_LIGHTUD))
|
||||||
|
@ -219,6 +219,7 @@ static void sink_sweep_ins(jit_State *J)
|
|||||||
for (ir = IR(J->cur.nk); ir < irbase; ir++) {
|
for (ir = IR(J->cur.nk); ir < irbase; ir++) {
|
||||||
irt_clearmark(ir->t);
|
irt_clearmark(ir->t);
|
||||||
ir->prev = REGSP_INIT;
|
ir->prev = REGSP_INIT;
|
||||||
|
/* The false-positive of irt_is64() for ASMREF_L (REF_NIL) is OK here. */
|
||||||
if (irt_is64(ir->t) && ir->o != IR_KNULL)
|
if (irt_is64(ir->t) && ir->o != IR_KNULL)
|
||||||
ir++;
|
ir++;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user