aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pall <mike>2014-03-04 16:11:29 +0100
committerMike Pall <mike>2014-03-04 16:11:29 +0100
commit19d53ed2f9f3633c35c5cc5c6492bb19d751e3b1 (patch)
treec86244dd114a38101ea3b166ef72822599ed5c64
parentfd3354a9dd3c8614ed4c5d7db048feb3ec89bd7b (diff)
downloadluajit-19d53ed2f9f3633c35c5cc5c6492bb19d751e3b1.tar.gz
luajit-19d53ed2f9f3633c35c5cc5c6492bb19d751e3b1.tar.bz2
luajit-19d53ed2f9f3633c35c5cc5c6492bb19d751e3b1.zip
Specialize to ffid for non-monomorphic builtins.
-rw-r--r--src/lj_ir.h1
-rw-r--r--src/lj_record.c5
2 files changed, 5 insertions, 1 deletions
diff --git a/src/lj_ir.h b/src/lj_ir.h
index f33f6355..14b86165 100644
--- a/src/lj_ir.h
+++ b/src/lj_ir.h
@@ -194,6 +194,7 @@ IRFPMDEF(FPMENUM)
194 _(STR_LEN, offsetof(GCstr, len)) \ 194 _(STR_LEN, offsetof(GCstr, len)) \
195 _(FUNC_ENV, offsetof(GCfunc, l.env)) \ 195 _(FUNC_ENV, offsetof(GCfunc, l.env)) \
196 _(FUNC_PC, offsetof(GCfunc, l.pc)) \ 196 _(FUNC_PC, offsetof(GCfunc, l.pc)) \
197 _(FUNC_FFID, offsetof(GCfunc, l.ffid)) \
197 _(THREAD_ENV, offsetof(lua_State, env)) \ 198 _(THREAD_ENV, offsetof(lua_State, env)) \
198 _(TAB_META, offsetof(GCtab, metatable)) \ 199 _(TAB_META, offsetof(GCtab, metatable)) \
199 _(TAB_ARRAY, offsetof(GCtab, array)) \ 200 _(TAB_ARRAY, offsetof(GCtab, array)) \
diff --git a/src/lj_record.c b/src/lj_record.c
index 9a3e3375..dbc096a2 100644
--- a/src/lj_record.c
+++ b/src/lj_record.c
@@ -648,7 +648,10 @@ static TRef rec_call_specialize(jit_State *J, GCfunc *fn, TRef tr)
648 case FF_coroutine_wrap_aux: 648 case FF_coroutine_wrap_aux:
649 case FF_string_gmatch_aux: 649 case FF_string_gmatch_aux:
650 /* NYI: io_file_iter doesn't have an ffid, yet. */ 650 /* NYI: io_file_iter doesn't have an ffid, yet. */
651 /* NYI: specialize to ffid? Not strictly necessary, trace will stop. */ 651 { /* Specialize to the ffid. */
652 TRef trid = emitir(IRT(IR_FLOAD, IRT_U8), tr, IRFL_FUNC_FFID);
653 emitir(IRTG(IR_EQ, IRT_INT), trid, lj_ir_kint(J, fn->c.ffid));
654 }
652 return tr; 655 return tr;
653 default: 656 default:
654 /* NYI: don't specialize to non-monomorphic C functions. */ 657 /* NYI: don't specialize to non-monomorphic C functions. */