aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-01-06 11:38:31 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-01-06 11:38:31 -0300
commit5ff408d2189c6c24fdf8908db4a31432bbdd6f15 (patch)
treebcd83d7547dab0d5418116eb10f9c601f2f2d3b9
parente3c83835e7b396ab7db538fb3b052f02d7807dee (diff)
downloadlua-5ff408d2189c6c24fdf8908db4a31432bbdd6f15.tar.gz
lua-5ff408d2189c6c24fdf8908db4a31432bbdd6f15.tar.bz2
lua-5ff408d2189c6c24fdf8908db4a31432bbdd6f15.zip
Changed internal representation of booleans
Instead of an explicit value (field 'b'), true and false use different tag variants. This avoids reading an extra field and results in more direct code. (Most code that uses booleans needs to distinguish between true and false anyway.)
-rw-r--r--lapi.c5
-rw-r--r--lcode.c50
-rw-r--r--ldebug.c2
-rw-r--r--ldump.c5
-rw-r--r--ljumptab.h3
-rw-r--r--llex.c2
-rw-r--r--lobject.h17
-rw-r--r--lopcodes.c3
-rw-r--r--lopcodes.h3
-rw-r--r--lopnames.h3
-rw-r--r--ltable.c10
-rw-r--r--lundump.c7
-rw-r--r--lvm.c19
-rw-r--r--testes/code.lua10
14 files changed, 87 insertions, 52 deletions
diff --git a/lapi.c b/lapi.c
index 073baa4d..0e99abef 100644
--- a/lapi.c
+++ b/lapi.c
@@ -574,7 +574,10 @@ LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) {
574 574
575LUA_API void lua_pushboolean (lua_State *L, int b) { 575LUA_API void lua_pushboolean (lua_State *L, int b) {
576 lua_lock(L); 576 lua_lock(L);
577 setbvalue(s2v(L->top), (b != 0)); /* ensure that true is 1 */ 577 if (b)
578 setbtvalue(s2v(L->top));
579 else
580 setbfvalue(s2v(L->top));
578 api_incr_top(L); 581 api_incr_top(L);
579 lua_unlock(L); 582 lua_unlock(L);
580} 583}
diff --git a/lcode.c b/lcode.c
index 4fc97e2b..72a8820b 100644
--- a/lcode.c
+++ b/lcode.c
@@ -84,8 +84,11 @@ int luaK_exp2const (FuncState *fs, const expdesc *e, TValue *v) {
84 if (hasjumps(e)) 84 if (hasjumps(e))
85 return 0; /* not a constant */ 85 return 0; /* not a constant */
86 switch (e->k) { 86 switch (e->k) {
87 case VFALSE: case VTRUE: 87 case VFALSE:
88 setbvalue(v, e->k == VTRUE); 88 setbfvalue(v);
89 return 1;
90 case VTRUE:
91 setbtvalue(v);
89 return 1; 92 return 1;
90 case VNIL: 93 case VNIL:
91 setnilvalue(v); 94 setnilvalue(v);
@@ -604,11 +607,21 @@ static int luaK_numberK (FuncState *fs, lua_Number r) {
604 607
605 608
606/* 609/*
607** Add a boolean to list of constants and return its index. 610** Add a false to list of constants and return its index.
608*/ 611*/
609static int boolK (FuncState *fs, int b) { 612static int boolF (FuncState *fs) {
610 TValue o; 613 TValue o;
611 setbvalue(&o, b); 614 setbfvalue(&o);
615 return addk(fs, &o, &o); /* use boolean itself as key */
616}
617
618
619/*
620** Add a true to list of constants and return its index.
621*/
622static int boolT (FuncState *fs) {
623 TValue o;
624 setbtvalue(&o);
612 return addk(fs, &o, &o); /* use boolean itself as key */ 625 return addk(fs, &o, &o); /* use boolean itself as key */
613} 626}
614 627
@@ -671,8 +684,11 @@ static void const2exp (TValue *v, expdesc *e) {
671 case LUA_TNUMFLT: 684 case LUA_TNUMFLT:
672 e->k = VKFLT; e->u.nval = fltvalue(v); 685 e->k = VKFLT; e->u.nval = fltvalue(v);
673 break; 686 break;
674 case LUA_TBOOLEAN: 687 case LUA_TFALSE:
675 e->k = bvalue(v) ? VTRUE : VFALSE; 688 e->k = VFALSE;
689 break;
690 case LUA_TTRUE:
691 e->k = VTRUE;
676 break; 692 break;
677 case LUA_TNIL: 693 case LUA_TNIL:
678 e->k = VNIL; 694 e->k = VNIL;
@@ -801,8 +817,12 @@ static void discharge2reg (FuncState *fs, expdesc *e, int reg) {
801 luaK_nil(fs, reg, 1); 817 luaK_nil(fs, reg, 1);
802 break; 818 break;
803 } 819 }
804 case VFALSE: case VTRUE: { 820 case VFALSE: {
805 luaK_codeABC(fs, OP_LOADBOOL, reg, e->k == VTRUE, 0); 821 luaK_codeABC(fs, OP_LOADFALSE, reg, 0, 0);
822 break;
823 }
824 case VTRUE: {
825 luaK_codeABC(fs, OP_LOADTRUE, reg, 0, 0);
806 break; 826 break;
807 } 827 }
808 case VKSTR: { 828 case VKSTR: {
@@ -852,9 +872,9 @@ static void discharge2anyreg (FuncState *fs, expdesc *e) {
852} 872}
853 873
854 874
855static int code_loadbool (FuncState *fs, int A, int b, int jump) { 875static int code_loadbool (FuncState *fs, int A, OpCode op, int jump) {
856 luaK_getlabel(fs); /* those instructions may be jump targets */ 876 luaK_getlabel(fs); /* those instructions may be jump targets */
857 return luaK_codeABC(fs, OP_LOADBOOL, A, b, jump); 877 return luaK_codeABC(fs, op, A, jump, 0);
858} 878}
859 879
860 880
@@ -888,8 +908,8 @@ static void exp2reg (FuncState *fs, expdesc *e, int reg) {
888 int p_t = NO_JUMP; /* position of an eventual LOAD true */ 908 int p_t = NO_JUMP; /* position of an eventual LOAD true */
889 if (need_value(fs, e->t) || need_value(fs, e->f)) { 909 if (need_value(fs, e->t) || need_value(fs, e->f)) {
890 int fj = (e->k == VJMP) ? NO_JUMP : luaK_jump(fs); 910 int fj = (e->k == VJMP) ? NO_JUMP : luaK_jump(fs);
891 p_f = code_loadbool(fs, reg, 0, 1); /* load false and skip next i. */ 911 p_f = code_loadbool(fs, reg, OP_LOADFALSE, 1); /* skip next inst. */
892 p_t = code_loadbool(fs, reg, 1, 0); /* load true */ 912 p_t = code_loadbool(fs, reg, OP_LOADTRUE, 0);
893 /* jump around these booleans if 'e' is not a test */ 913 /* jump around these booleans if 'e' is not a test */
894 luaK_patchtohere(fs, fj); 914 luaK_patchtohere(fs, fj);
895 } 915 }
@@ -963,8 +983,8 @@ static int luaK_exp2K (FuncState *fs, expdesc *e) {
963 if (!hasjumps(e)) { 983 if (!hasjumps(e)) {
964 int info; 984 int info;
965 switch (e->k) { /* move constants to 'k' */ 985 switch (e->k) { /* move constants to 'k' */
966 case VTRUE: info = boolK(fs, 1); break; 986 case VTRUE: info = boolT(fs); break;
967 case VFALSE: info = boolK(fs, 0); break; 987 case VFALSE: info = boolF(fs); break;
968 case VNIL: info = nilK(fs); break; 988 case VNIL: info = nilK(fs); break;
969 case VKINT: info = luaK_intK(fs, e->u.ival); break; 989 case VKINT: info = luaK_intK(fs, e->u.ival); break;
970 case VKFLT: info = luaK_numberK(fs, e->u.nval); break; 990 case VKFLT: info = luaK_numberK(fs, e->u.nval); break;
diff --git a/ldebug.c b/ldebug.c
index 6e16b0fb..c229f759 100644
--- a/ldebug.c
+++ b/ldebug.c
@@ -306,7 +306,7 @@ static void collectvalidlines (lua_State *L, Closure *f) {
306 Table *t = luaH_new(L); /* new table to store active lines */ 306 Table *t = luaH_new(L); /* new table to store active lines */
307 sethvalue2s(L, L->top, t); /* push it on stack */ 307 sethvalue2s(L, L->top, t); /* push it on stack */
308 api_incr_top(L); 308 api_incr_top(L);
309 setbvalue(&v, 1); /* boolean 'true' to be the value of all indices */ 309 setbtvalue(&v); /* boolean 'true' to be the value of all indices */
310 for (i = 0; i < p->sizelineinfo; i++) { /* for all lines with code */ 310 for (i = 0; i < p->sizelineinfo; i++) { /* for all lines with code */
311 currentline = nextline(p, currentline, i); 311 currentline = nextline(p, currentline, i);
312 luaH_setint(L, t, currentline, &v); /* table[line] = true */ 312 luaH_setint(L, t, currentline, &v); /* table[line] = true */
diff --git a/ldump.c b/ldump.c
index 9b501729..93cadbcc 100644
--- a/ldump.c
+++ b/ldump.c
@@ -113,10 +113,7 @@ static void DumpConstants (const Proto *f, DumpState *D) {
113 const TValue *o = &f->k[i]; 113 const TValue *o = &f->k[i];
114 DumpByte(ttypetag(o), D); 114 DumpByte(ttypetag(o), D);
115 switch (ttypetag(o)) { 115 switch (ttypetag(o)) {
116 case LUA_TNIL: 116 case LUA_TNIL: case LUA_TFALSE: case LUA_TTRUE:
117 break;
118 case LUA_TBOOLEAN:
119 DumpByte(bvalue(o), D);
120 break; 117 break;
121 case LUA_TNUMFLT: 118 case LUA_TNUMFLT:
122 DumpNumber(fltvalue(o), D); 119 DumpNumber(fltvalue(o), D);
diff --git a/ljumptab.h b/ljumptab.h
index 37fe1e25..22e9575f 100644
--- a/ljumptab.h
+++ b/ljumptab.h
@@ -30,7 +30,8 @@ static void *disptab[NUM_OPCODES] = {
30&&L_OP_LOADF, 30&&L_OP_LOADF,
31&&L_OP_LOADK, 31&&L_OP_LOADK,
32&&L_OP_LOADKX, 32&&L_OP_LOADKX,
33&&L_OP_LOADBOOL, 33&&L_OP_LOADFALSE,
34&&L_OP_LOADTRUE,
34&&L_OP_LOADNIL, 35&&L_OP_LOADNIL,
35&&L_OP_GETUPVAL, 36&&L_OP_GETUPVAL,
36&&L_OP_SETUPVAL, 37&&L_OP_SETUPVAL,
diff --git a/llex.c b/llex.c
index f88057fe..90a7951f 100644
--- a/llex.c
+++ b/llex.c
@@ -136,7 +136,7 @@ TString *luaX_newstring (LexState *ls, const char *str, size_t l) {
136 if (isempty(o)) { /* not in use yet? */ 136 if (isempty(o)) { /* not in use yet? */
137 /* boolean value does not need GC barrier; 137 /* boolean value does not need GC barrier;
138 table is not a metatable, so it does not need to invalidate cache */ 138 table is not a metatable, so it does not need to invalidate cache */
139 setbvalue(o, 1); /* t[string] = true */ 139 setbtvalue(o); /* t[string] = true */
140 luaC_checkGC(L); 140 luaC_checkGC(L);
141 } 141 }
142 else { /* string already present */ 142 else { /* string already present */
diff --git a/lobject.h b/lobject.h
index 7d30b46f..a529ceba 100644
--- a/lobject.h
+++ b/lobject.h
@@ -44,7 +44,6 @@
44typedef union Value { 44typedef union Value {
45 struct GCObject *gc; /* collectable objects */ 45 struct GCObject *gc; /* collectable objects */
46 void *p; /* light userdata */ 46 void *p; /* light userdata */
47 int b; /* booleans */
48 lua_CFunction f; /* light C functions */ 47 lua_CFunction f; /* light C functions */
49 lua_Integer i; /* integer numbers */ 48 lua_Integer i; /* integer numbers */
50 lua_Number n; /* float numbers */ 49 lua_Number n; /* float numbers */
@@ -210,16 +209,20 @@ typedef StackValue *StkId;
210** =================================================================== 209** ===================================================================
211*/ 210*/
212 211
213#define ttisboolean(o) checktag((o), LUA_TBOOLEAN)
214 212
215#define bvalue(o) check_exp(ttisboolean(o), val_(o).b) 213#define LUA_TFALSE (LUA_TBOOLEAN | (1 << 4))
214#define LUA_TTRUE (LUA_TBOOLEAN | (2 << 4))
216 215
217#define bvalueraw(v) ((v).b) 216#define ttisboolean(o) checktype((o), LUA_TBOOLEAN)
217#define ttisfalse(o) checktag((o), LUA_TFALSE)
218#define ttistrue(o) checktag((o), LUA_TTRUE)
218 219
219#define l_isfalse(o) (ttisboolean(o) ? bvalue(o) == 0 : ttisnil(o))
220 220
221#define setbvalue(obj,x) \ 221#define l_isfalse(o) (ttisfalse(o) || ttisnil(o))
222 { TValue *io=(obj); val_(io).b=(x); settt_(io, LUA_TBOOLEAN); } 222
223
224#define setbfvalue(obj) settt_(obj, LUA_TFALSE)
225#define setbtvalue(obj) settt_(obj, LUA_TTRUE)
223 226
224/* }================================================================== */ 227/* }================================================================== */
225 228
diff --git a/lopcodes.c b/lopcodes.c
index 90d4cd1a..f5347a3c 100644
--- a/lopcodes.c
+++ b/lopcodes.c
@@ -24,7 +24,8 @@ LUAI_DDEF const lu_byte luaP_opmodes[NUM_OPCODES] = {
24 ,opmode(0, 0, 0, 0, 1, iAsBx) /* OP_LOADF */ 24 ,opmode(0, 0, 0, 0, 1, iAsBx) /* OP_LOADF */
25 ,opmode(0, 0, 0, 0, 1, iABx) /* OP_LOADK */ 25 ,opmode(0, 0, 0, 0, 1, iABx) /* OP_LOADK */
26 ,opmode(0, 0, 0, 0, 1, iABx) /* OP_LOADKX */ 26 ,opmode(0, 0, 0, 0, 1, iABx) /* OP_LOADKX */
27 ,opmode(0, 0, 0, 0, 1, iABC) /* OP_LOADBOOL */ 27 ,opmode(0, 0, 0, 0, 1, iABC) /* OP_LOADFALSE */
28 ,opmode(0, 0, 0, 0, 1, iABC) /* OP_LOADTRUE */
28 ,opmode(0, 0, 0, 0, 1, iABC) /* OP_LOADNIL */ 29 ,opmode(0, 0, 0, 0, 1, iABC) /* OP_LOADNIL */
29 ,opmode(0, 0, 0, 0, 1, iABC) /* OP_GETUPVAL */ 30 ,opmode(0, 0, 0, 0, 1, iABC) /* OP_GETUPVAL */
30 ,opmode(0, 0, 0, 0, 0, iABC) /* OP_SETUPVAL */ 31 ,opmode(0, 0, 0, 0, 0, iABC) /* OP_SETUPVAL */
diff --git a/lopcodes.h b/lopcodes.h
index aec9dcbc..f512f15a 100644
--- a/lopcodes.h
+++ b/lopcodes.h
@@ -202,7 +202,8 @@ OP_LOADI,/* A sBx R[A] := sBx */
202OP_LOADF,/* A sBx R[A] := (lua_Number)sBx */ 202OP_LOADF,/* A sBx R[A] := (lua_Number)sBx */
203OP_LOADK,/* A Bx R[A] := K[Bx] */ 203OP_LOADK,/* A Bx R[A] := K[Bx] */
204OP_LOADKX,/* A R[A] := K[extra arg] */ 204OP_LOADKX,/* A R[A] := K[extra arg] */
205OP_LOADBOOL,/* A B C R[A] := (Bool)B; if (C) pc++ */ 205OP_LOADFALSE,/* A B R[A] := false; if (B) pc++ */
206OP_LOADTRUE,/* A R[A] := true */
206OP_LOADNIL,/* A B R[A], R[A+1], ..., R[A+B] := nil */ 207OP_LOADNIL,/* A B R[A], R[A+1], ..., R[A+B] := nil */
207OP_GETUPVAL,/* A B R[A] := UpValue[B] */ 208OP_GETUPVAL,/* A B R[A] := UpValue[B] */
208OP_SETUPVAL,/* A B UpValue[B] := R[A] */ 209OP_SETUPVAL,/* A B UpValue[B] := R[A] */
diff --git a/lopnames.h b/lopnames.h
index de347301..a2097a74 100644
--- a/lopnames.h
+++ b/lopnames.h
@@ -15,7 +15,8 @@ static const char *const opnames[] = {
15 "LOADF", 15 "LOADF",
16 "LOADK", 16 "LOADK",
17 "LOADKX", 17 "LOADKX",
18 "LOADBOOL", 18 "LOADFALSE",
19 "LOADTRUE",
19 "LOADNIL", 20 "LOADNIL",
20 "GETUPVAL", 21 "GETUPVAL",
21 "SETUPVAL", 22 "SETUPVAL",
diff --git a/ltable.c b/ltable.c
index cc3c3dd4..ebd45dda 100644
--- a/ltable.c
+++ b/ltable.c
@@ -143,8 +143,10 @@ static Node *mainposition (const Table *t, int ktt, const Value *kvl) {
143 return hashstr(t, tsvalueraw(*kvl)); 143 return hashstr(t, tsvalueraw(*kvl));
144 case LUA_TLNGSTR: 144 case LUA_TLNGSTR:
145 return hashpow2(t, luaS_hashlongstr(tsvalueraw(*kvl))); 145 return hashpow2(t, luaS_hashlongstr(tsvalueraw(*kvl)));
146 case LUA_TBOOLEAN: 146 case LUA_TFALSE:
147 return hashboolean(t, bvalueraw(*kvl)); 147 return hashboolean(t, 0);
148 case LUA_TTRUE:
149 return hashboolean(t, 1);
148 case LUA_TLIGHTUSERDATA: 150 case LUA_TLIGHTUSERDATA:
149 return hashpointer(t, pvalueraw(*kvl)); 151 return hashpointer(t, pvalueraw(*kvl));
150 case LUA_TLCF: 152 case LUA_TLCF:
@@ -175,14 +177,12 @@ static int equalkey (const TValue *k1, const Node *n2) {
175 if (rawtt(k1) != keytt(n2)) /* not the same variants? */ 177 if (rawtt(k1) != keytt(n2)) /* not the same variants? */
176 return 0; /* cannot be same key */ 178 return 0; /* cannot be same key */
177 switch (ttypetag(k1)) { 179 switch (ttypetag(k1)) {
178 case LUA_TNIL: 180 case LUA_TNIL: case LUA_TFALSE: case LUA_TTRUE:
179 return 1; 181 return 1;
180 case LUA_TNUMINT: 182 case LUA_TNUMINT:
181 return (ivalue(k1) == keyival(n2)); 183 return (ivalue(k1) == keyival(n2));
182 case LUA_TNUMFLT: 184 case LUA_TNUMFLT:
183 return luai_numeq(fltvalue(k1), fltvalueraw(keyval(n2))); 185 return luai_numeq(fltvalue(k1), fltvalueraw(keyval(n2)));
184 case LUA_TBOOLEAN:
185 return bvalue(k1) == bvalueraw(keyval(n2));
186 case LUA_TLIGHTUSERDATA: 186 case LUA_TLIGHTUSERDATA:
187 return pvalue(k1) == pvalueraw(keyval(n2)); 187 return pvalue(k1) == pvalueraw(keyval(n2));
188 case LUA_TLCF: 188 case LUA_TLCF:
diff --git a/lundump.c b/lundump.c
index 8f2a490c..45e0b637 100644
--- a/lundump.c
+++ b/lundump.c
@@ -160,8 +160,11 @@ static void LoadConstants (LoadState *S, Proto *f) {
160 case LUA_TNIL: 160 case LUA_TNIL:
161 setnilvalue(o); 161 setnilvalue(o);
162 break; 162 break;
163 case LUA_TBOOLEAN: 163 case LUA_TFALSE:
164 setbvalue(o, LoadByte(S)); 164 setbfvalue(o);
165 break;
166 case LUA_TTRUE:
167 setbtvalue(o);
165 break; 168 break;
166 case LUA_TNUMFLT: 169 case LUA_TNUMFLT:
167 setfltvalue(o, LoadNumber(S)); 170 setfltvalue(o, LoadNumber(S));
diff --git a/lvm.c b/lvm.c
index 78c0ebe7..656def81 100644
--- a/lvm.c
+++ b/lvm.c
@@ -577,10 +577,9 @@ int luaV_equalobj (lua_State *L, const TValue *t1, const TValue *t2) {
577 } 577 }
578 /* values have same type and same variant */ 578 /* values have same type and same variant */
579 switch (ttypetag(t1)) { 579 switch (ttypetag(t1)) {
580 case LUA_TNIL: return 1; 580 case LUA_TNIL: case LUA_TFALSE: case LUA_TTRUE: return 1;
581 case LUA_TNUMINT: return (ivalue(t1) == ivalue(t2)); 581 case LUA_TNUMINT: return (ivalue(t1) == ivalue(t2));
582 case LUA_TNUMFLT: return luai_numeq(fltvalue(t1), fltvalue(t2)); 582 case LUA_TNUMFLT: return luai_numeq(fltvalue(t1), fltvalue(t2));
583 case LUA_TBOOLEAN: return bvalue(t1) == bvalue(t2); /* true must be 1! */
584 case LUA_TLIGHTUSERDATA: return pvalue(t1) == pvalue(t2); 583 case LUA_TLIGHTUSERDATA: return pvalue(t1) == pvalue(t2);
585 case LUA_TLCF: return fvalue(t1) == fvalue(t2); 584 case LUA_TLCF: return fvalue(t1) == fvalue(t2);
586 case LUA_TSHRSTR: return eqshrstr(tsvalue(t1), tsvalue(t2)); 585 case LUA_TSHRSTR: return eqshrstr(tsvalue(t1), tsvalue(t2));
@@ -1182,9 +1181,13 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
1182 setobj2s(L, ra, rb); 1181 setobj2s(L, ra, rb);
1183 vmbreak; 1182 vmbreak;
1184 } 1183 }
1185 vmcase(OP_LOADBOOL) { 1184 vmcase(OP_LOADFALSE) {
1186 setbvalue(s2v(ra), GETARG_B(i)); 1185 setbfvalue(s2v(ra));
1187 if (GETARG_C(i)) pc++; /* skip next instruction (if C) */ 1186 if (GETARG_B(i)) pc++; /* if B, skip next instruction */
1187 vmbreak;
1188 }
1189 vmcase(OP_LOADTRUE) {
1190 setbtvalue(s2v(ra));
1188 vmbreak; 1191 vmbreak;
1189 } 1192 }
1190 vmcase(OP_LOADNIL) { 1193 vmcase(OP_LOADNIL) {
@@ -1503,8 +1506,10 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
1503 } 1506 }
1504 vmcase(OP_NOT) { 1507 vmcase(OP_NOT) {
1505 TValue *rb = vRB(i); 1508 TValue *rb = vRB(i);
1506 int nrb = l_isfalse(rb); /* next assignment may change this value */ 1509 if (l_isfalse(rb))
1507 setbvalue(s2v(ra), nrb); 1510 setbtvalue(s2v(ra));
1511 else
1512 setbfvalue(s2v(ra));
1508 vmbreak; 1513 vmbreak;
1509 } 1514 }
1510 vmcase(OP_LEN) { 1515 vmcase(OP_LEN) {
diff --git a/testes/code.lua b/testes/code.lua
index e12f3f91..34b04668 100644
--- a/testes/code.lua
+++ b/testes/code.lua
@@ -144,10 +144,10 @@ check(function (a,b,c,d) return a..b..c..d end,
144 'MOVE', 'MOVE', 'MOVE', 'MOVE', 'CONCAT', 'RETURN1') 144 'MOVE', 'MOVE', 'MOVE', 'MOVE', 'CONCAT', 'RETURN1')
145 145
146-- not 146-- not
147check(function () return not not nil end, 'LOADBOOL', 'RETURN1') 147check(function () return not not nil end, 'LOADFALSE', 'RETURN1')
148check(function () return not not kFalse end, 'LOADBOOL', 'RETURN1') 148check(function () return not not kFalse end, 'LOADFALSE', 'RETURN1')
149check(function () return not not true end, 'LOADBOOL', 'RETURN1') 149check(function () return not not true end, 'LOADTRUE', 'RETURN1')
150check(function () return not not k3 end, 'LOADBOOL', 'RETURN1') 150check(function () return not not k3 end, 'LOADTRUE', 'RETURN1')
151 151
152-- direct access to locals 152-- direct access to locals
153check(function () 153check(function ()
@@ -194,7 +194,7 @@ check(function ()
194 local a,b 194 local a,b
195 a[kTrue] = false 195 a[kTrue] = false
196end, 196end,
197 'LOADNIL', 'LOADBOOL', 'SETTABLE', 'RETURN0') 197 'LOADNIL', 'LOADTRUE', 'SETTABLE', 'RETURN0')
198 198
199 199
200-- equalities 200-- equalities