aboutsummaryrefslogtreecommitdiff
path: root/src/lj_ir.c
diff options
context:
space:
mode:
authorMike Pall <mike>2016-11-19 19:53:46 +0100
committerMike Pall <mike>2016-11-19 19:53:46 +0100
commite577db52c543303543c9e30e8ebe0c244e1b85c8 (patch)
tree745f5c5e39aa83f66f2ceb3e3145f44f551a197c /src/lj_ir.c
parent5400c1e42469cdb3cb5df691baa877b762b27704 (diff)
downloadluajit-e577db52c543303543c9e30e8ebe0c244e1b85c8.tar.gz
luajit-e577db52c543303543c9e30e8ebe0c244e1b85c8.tar.bz2
luajit-e577db52c543303543c9e30e8ebe0c244e1b85c8.zip
Increase range of GG_State loads via IR_FLOAD with REF_NIL.
Require 32 bit alignment and store offset/4 instead. Otherwise this can overflow the 10 bit limit for the FOLD op2 key.
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}