summaryrefslogtreecommitdiff
path: root/src/lj_meta.c
diff options
context:
space:
mode:
authorMike Pall <mike>2009-12-08 20:35:29 +0100
committerMike Pall <mike>2009-12-08 20:35:29 +0100
commit3f1f9e11f4f699ae94182d4cba158092f434a7f6 (patch)
tree88fbb674a21a1d554d4b1ee9d4ef2c5fed6a1d88 /src/lj_meta.c
parent5287b9326479ea2b7dddd6f642673e58e5a7f354 (diff)
downloadluajit2-3f1f9e11f4f699ae94182d4cba158092f434a7f6.tar.gz
Fast forward to sync public repo.
Compile math.sinh(), math.cosh(), math.tanh() and math.random(). Compile various io.*() functions. Drive the GC forward on string allocations in the parser. Improve KNUM fuse vs. load heuristics. Add abstract C call handling to IR.
Diffstat (limited to 'src/lj_meta.c')
-rw-r--r--src/lj_meta.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lj_meta.c b/src/lj_meta.c
index dff01f85..1182d908 100644
--- a/src/lj_meta.c
+++ b/src/lj_meta.c
@@ -60,7 +60,7 @@ cTValue *lj_meta_lookup(lua_State *L, cTValue *o, MMS mm)
else if (tvisudata(o))
mt = tabref(udataV(o)->metatable);
else
- mt = tabref(G(L)->basemt[itypemap(o)]);
+ mt = tabref(basemt_obj(G(L), o));
if (mt) {
cTValue *mo = lj_tab_getstr(mt, strref(G(L)->mmname[mm]));
if (mo)
@@ -157,7 +157,7 @@ static cTValue *str2num(cTValue *o, TValue *n)
{
if (tvisnum(o))
return o;
- else if (tvisstr(o) && lj_str_numconv(strVdata(o), n))
+ else if (tvisstr(o) && lj_str_tonum(strV(o), n))
return n;
else
return NULL;
@@ -295,7 +295,7 @@ TValue *lj_meta_equal(lua_State *L, GCobj *o1, GCobj *o2, int ne)
top = curr_top(L);
setcont(top, ne ? lj_cont_condf : lj_cont_condt);
copyTV(L, top+1, mo);
- it = o1->gch.gct == ~LJ_TTAB ? LJ_TTAB : LJ_TUDATA;
+ it = ~o1->gch.gct;
setgcV(L, top+2, &o1->gch, it);
setgcV(L, top+3, &o2->gch, it);
return top+2; /* Trigger metamethod call. */