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.)
This commit is contained in:
Roberto Ierusalimschy
2020-01-06 11:38:31 -03:00
parent e3c83835e7
commit 5ff408d218
14 changed files with 87 additions and 52 deletions

View File

@@ -202,7 +202,8 @@ OP_LOADI,/* A sBx R[A] := sBx */
OP_LOADF,/* A sBx R[A] := (lua_Number)sBx */
OP_LOADK,/* A Bx R[A] := K[Bx] */
OP_LOADKX,/* A R[A] := K[extra arg] */
OP_LOADBOOL,/* A B C R[A] := (Bool)B; if (C) pc++ */
OP_LOADFALSE,/* A B R[A] := false; if (B) pc++ */
OP_LOADTRUE,/* A R[A] := true */
OP_LOADNIL,/* A B R[A], R[A+1], ..., R[A+B] := nil */
OP_GETUPVAL,/* A B R[A] := UpValue[B] */
OP_SETUPVAL,/* A B UpValue[B] := R[A] */