aboutsummaryrefslogtreecommitdiff
path: root/lopcodes.h
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.h
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.h')
-rw-r--r--lopcodes.h3
1 files changed, 2 insertions, 1 deletions
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] */