diff --git a/src/lj_asm_arm64.h b/src/lj_asm_arm64.h index 5e690308..a575269b 100644 --- a/src/lj_asm_arm64.h +++ b/src/lj_asm_arm64.h @@ -831,10 +831,13 @@ static void asm_href(ASMState *as, IRIns *ir, IROp merge) /* Key not found in chain: jump to exit (if merged) or load niltv. */ l_end = emit_label(as); as->invmcp = NULL; - if (merge == IR_NE) + if (merge == IR_NE) { asm_guardcc(as, CC_AL); - else if (destused) - emit_loada(as, dest, niltvg(J2G(as->J))); + } else if (destused) { + uint32_t k12 = emit_isk12(offsetof(global_State, nilnode.val)); + lj_assertA(k12 != 0, "Cannot k12 encode niltv(L)"); + emit_dn(as, A64I_ADDx^k12, dest, RID_GL); + } /* Follow hash chain until the end. */ l_loop = --as->mcp; diff --git a/src/lj_emit_arm64.h b/src/lj_emit_arm64.h index 7205ce78..73df508c 100644 --- a/src/lj_emit_arm64.h +++ b/src/lj_emit_arm64.h @@ -230,8 +230,6 @@ static void emit_loadk(ASMState *as, Reg rd, uint64_t u64, int is64) /* Load a 64 bit constant into a GPR. */ #define emit_loadu64(as, rd, i) emit_loadk(as, rd, i, A64I_X) -#define emit_loada(as, r, addr) emit_loadu64(as, (r), (uintptr_t)(addr)) - #define glofs(as, k) \ ((intptr_t)((uintptr_t)(k) - (uintptr_t)&J2GG(as->J)->g)) #define mcpofs(as, k) \