aboutsummaryrefslogtreecommitdiff
path: root/src/lj_ir.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_ir.c')
-rw-r--r--src/lj_ir.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lj_ir.c b/src/lj_ir.c
index 87fd0f4d..c5c521be 100644
--- a/src/lj_ir.c
+++ b/src/lj_ir.c
@@ -145,10 +145,12 @@ TRef lj_ir_call(jit_State *J, IRCallID id, ...)
145 return emitir(CCI_OPTYPE(ci), tr, id); 145 return emitir(CCI_OPTYPE(ci), tr, id);
146} 146}
147 147
148/* Load field of type t from GG_State + offset. */ 148/* Load field of type t from GG_State + offset. Must be 32 bit aligned. */
149LJ_FUNC TRef lj_ir_ggfload(jit_State *J, IRType t, uintptr_t ofs) 149LJ_FUNC TRef lj_ir_ggfload(jit_State *J, IRType t, uintptr_t ofs)
150{ 150{
151 lua_assert(ofs >= IRFL__MAX && ofs < REF_BIAS); 151 lua_assert((ofs & 3) == 0);
152 ofs >>= 2;
153 lua_assert(ofs >= IRFL__MAX && ofs <= 0x3ff); /* 10 bit FOLD key limit. */
152 lj_ir_set(J, IRT(IR_FLOAD, t), REF_NIL, ofs); 154 lj_ir_set(J, IRT(IR_FLOAD, t), REF_NIL, ofs);
153 return lj_opt_fold(J); 155 return lj_opt_fold(J);
154} 156}