aboutsummaryrefslogtreecommitdiff
path: root/lopcodes.c
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 /lopcodes.c
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.)
Diffstat (limited to 'lopcodes.c')
-rw-r--r--lopcodes.c3
1 files changed, 2 insertions, 1 deletions
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 */