aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lcode.c7
-rw-r--r--lopcodes.h8
-rw-r--r--ltable.c3
-rw-r--r--ltable.h2
-rw-r--r--lvm.c8
5 files changed, 14 insertions, 14 deletions
diff --git a/lcode.c b/lcode.c
index 1a371ca9..eade2806 100644
--- a/lcode.c
+++ b/lcode.c
@@ -1215,7 +1215,7 @@ static void codenot (FuncState *fs, expdesc *e) {
1215 1215
1216 1216
1217/* 1217/*
1218** Check whether expression 'e' is a small literal string 1218** Check whether expression 'e' is a short literal string
1219*/ 1219*/
1220static int isKstr (FuncState *fs, expdesc *e) { 1220static int isKstr (FuncState *fs, expdesc *e) {
1221 return (e->k == VK && !hasjumps(e) && e->u.info <= MAXARG_B && 1221 return (e->k == VK && !hasjumps(e) && e->u.info <= MAXARG_B &&
@@ -1283,15 +1283,16 @@ void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k) {
1283 if (t->k == VUPVAL && !isKstr(fs, k)) /* upvalue indexed by non 'Kstr'? */ 1283 if (t->k == VUPVAL && !isKstr(fs, k)) /* upvalue indexed by non 'Kstr'? */
1284 luaK_exp2anyreg(fs, t); /* put it in a register */ 1284 luaK_exp2anyreg(fs, t); /* put it in a register */
1285 if (t->k == VUPVAL) { 1285 if (t->k == VUPVAL) {
1286 lua_assert(isKstr(fs, k));
1286 t->u.ind.t = t->u.info; /* upvalue index */ 1287 t->u.ind.t = t->u.info; /* upvalue index */
1287 t->u.ind.idx = k->u.info; /* literal string */ 1288 t->u.ind.idx = k->u.info; /* literal short string */
1288 t->k = VINDEXUP; 1289 t->k = VINDEXUP;
1289 } 1290 }
1290 else { 1291 else {
1291 /* register index of the table */ 1292 /* register index of the table */
1292 t->u.ind.t = (t->k == VLOCAL) ? t->u.var.ridx: t->u.info; 1293 t->u.ind.t = (t->k == VLOCAL) ? t->u.var.ridx: t->u.info;
1293 if (isKstr(fs, k)) { 1294 if (isKstr(fs, k)) {
1294 t->u.ind.idx = k->u.info; /* literal string */ 1295 t->u.ind.idx = k->u.info; /* literal short string */
1295 t->k = VINDEXSTR; 1296 t->k = VINDEXSTR;
1296 } 1297 }
1297 else if (isCint(k)) { 1298 else if (isCint(k)) {
diff --git a/lopcodes.h b/lopcodes.h
index 4c551453..46911cac 100644
--- a/lopcodes.h
+++ b/lopcodes.h
@@ -210,15 +210,15 @@ OP_LOADNIL,/* A B R[A], R[A+1], ..., R[A+B] := nil */
210OP_GETUPVAL,/* A B R[A] := UpValue[B] */ 210OP_GETUPVAL,/* A B R[A] := UpValue[B] */
211OP_SETUPVAL,/* A B UpValue[B] := R[A] */ 211OP_SETUPVAL,/* A B UpValue[B] := R[A] */
212 212
213OP_GETTABUP,/* A B C R[A] := UpValue[B][K[C]:string] */ 213OP_GETTABUP,/* A B C R[A] := UpValue[B][K[C]:shortstring] */
214OP_GETTABLE,/* A B C R[A] := R[B][R[C]] */ 214OP_GETTABLE,/* A B C R[A] := R[B][R[C]] */
215OP_GETI,/* A B C R[A] := R[B][C] */ 215OP_GETI,/* A B C R[A] := R[B][C] */
216OP_GETFIELD,/* A B C R[A] := R[B][K[C]:string] */ 216OP_GETFIELD,/* A B C R[A] := R[B][K[C]:shortstring] */
217 217
218OP_SETTABUP,/* A B C UpValue[A][K[B]:string] := RK(C) */ 218OP_SETTABUP,/* A B C UpValue[A][K[B]:shortstring] := RK(C) */
219OP_SETTABLE,/* A B C R[A][R[B]] := RK(C) */ 219OP_SETTABLE,/* A B C R[A][R[B]] := RK(C) */
220OP_SETI,/* A B C R[A][B] := RK(C) */ 220OP_SETI,/* A B C R[A][B] := RK(C) */
221OP_SETFIELD,/* A B C R[A][K[B]:string] := RK(C) */ 221OP_SETFIELD,/* A B C R[A][K[B]:shortstring] := RK(C) */
222 222
223OP_NEWTABLE,/* A B C k R[A] := {} */ 223OP_NEWTABLE,/* A B C k R[A] := {} */
224 224
diff --git a/ltable.c b/ltable.c
index 3c690c5f..3fb575a1 100644
--- a/ltable.c
+++ b/ltable.c
@@ -662,7 +662,8 @@ static Node *getfreepos (Table *t) {
662** put new key in its main position; otherwise (colliding node is in its main 662** put new key in its main position; otherwise (colliding node is in its main
663** position), new key goes to an empty position. 663** position), new key goes to an empty position.
664*/ 664*/
665void luaH_newkey (lua_State *L, Table *t, const TValue *key, TValue *value) { 665static void luaH_newkey (lua_State *L, Table *t, const TValue *key,
666 TValue *value) {
666 Node *mp; 667 Node *mp;
667 TValue aux; 668 TValue aux;
668 if (l_unlikely(ttisnil(key))) 669 if (l_unlikely(ttisnil(key)))
diff --git a/ltable.h b/ltable.h
index 75dd9e26..8e689034 100644
--- a/ltable.h
+++ b/ltable.h
@@ -41,8 +41,6 @@ LUAI_FUNC void luaH_setint (lua_State *L, Table *t, lua_Integer key,
41LUAI_FUNC const TValue *luaH_getshortstr (Table *t, TString *key); 41LUAI_FUNC const TValue *luaH_getshortstr (Table *t, TString *key);
42LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key); 42LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key);
43LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key); 43LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key);
44LUAI_FUNC void luaH_newkey (lua_State *L, Table *t, const TValue *key,
45 TValue *value);
46LUAI_FUNC void luaH_set (lua_State *L, Table *t, const TValue *key, 44LUAI_FUNC void luaH_set (lua_State *L, Table *t, const TValue *key,
47 TValue *value); 45 TValue *value);
48LUAI_FUNC void luaH_finishset (lua_State *L, Table *t, const TValue *key, 46LUAI_FUNC void luaH_finishset (lua_State *L, Table *t, const TValue *key,
diff --git a/lvm.c b/lvm.c
index 8493a770..4c300a87 100644
--- a/lvm.c
+++ b/lvm.c
@@ -1253,7 +1253,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
1253 const TValue *slot; 1253 const TValue *slot;
1254 TValue *upval = cl->upvals[GETARG_B(i)]->v.p; 1254 TValue *upval = cl->upvals[GETARG_B(i)]->v.p;
1255 TValue *rc = KC(i); 1255 TValue *rc = KC(i);
1256 TString *key = tsvalue(rc); /* key must be a string */ 1256 TString *key = tsvalue(rc); /* key must be a short string */
1257 if (luaV_fastget(L, upval, key, slot, luaH_getshortstr)) { 1257 if (luaV_fastget(L, upval, key, slot, luaH_getshortstr)) {
1258 setobj2s(L, ra, slot); 1258 setobj2s(L, ra, slot);
1259 } 1259 }
@@ -1296,7 +1296,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
1296 const TValue *slot; 1296 const TValue *slot;
1297 TValue *rb = vRB(i); 1297 TValue *rb = vRB(i);
1298 TValue *rc = KC(i); 1298 TValue *rc = KC(i);
1299 TString *key = tsvalue(rc); /* key must be a string */ 1299 TString *key = tsvalue(rc); /* key must be a short string */
1300 if (luaV_fastget(L, rb, key, slot, luaH_getshortstr)) { 1300 if (luaV_fastget(L, rb, key, slot, luaH_getshortstr)) {
1301 setobj2s(L, ra, slot); 1301 setobj2s(L, ra, slot);
1302 } 1302 }
@@ -1309,7 +1309,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
1309 TValue *upval = cl->upvals[GETARG_A(i)]->v.p; 1309 TValue *upval = cl->upvals[GETARG_A(i)]->v.p;
1310 TValue *rb = KB(i); 1310 TValue *rb = KB(i);
1311 TValue *rc = RKC(i); 1311 TValue *rc = RKC(i);
1312 TString *key = tsvalue(rb); /* key must be a string */ 1312 TString *key = tsvalue(rb); /* key must be a short string */
1313 if (luaV_fastget(L, upval, key, slot, luaH_getshortstr)) { 1313 if (luaV_fastget(L, upval, key, slot, luaH_getshortstr)) {
1314 luaV_finishfastset(L, upval, slot, rc); 1314 luaV_finishfastset(L, upval, slot, rc);
1315 } 1315 }
@@ -1352,7 +1352,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
1352 const TValue *slot; 1352 const TValue *slot;
1353 TValue *rb = KB(i); 1353 TValue *rb = KB(i);
1354 TValue *rc = RKC(i); 1354 TValue *rc = RKC(i);
1355 TString *key = tsvalue(rb); /* key must be a string */ 1355 TString *key = tsvalue(rb); /* key must be a short string */
1356 if (luaV_fastget(L, s2v(ra), key, slot, luaH_getshortstr)) { 1356 if (luaV_fastget(L, s2v(ra), key, slot, luaH_getshortstr)) {
1357 luaV_finishfastset(L, s2v(ra), slot, rc); 1357 luaV_finishfastset(L, s2v(ra), slot, rc);
1358 } 1358 }