aboutsummaryrefslogtreecommitdiff
path: root/lobject.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-07-09 10:43:17 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-07-09 10:43:17 -0300
commit54f7b46c1e8a0188e1649046a3a72522f2d769f4 (patch)
tree28e973e10e2bc82de4d7d1e7a9f6673b028f7ad2 /lobject.h
parente888976bc6ba5592fb8ab8ecc04a8f63e217aa74 (diff)
downloadlua-54f7b46c1e8a0188e1649046a3a72522f2d769f4.tar.gz
lua-54f7b46c1e8a0188e1649046a3a72522f2d769f4.tar.bz2
lua-54f7b46c1e8a0188e1649046a3a72522f2d769f4.zip
New implementation for constants
VLOCAL expressions keep a reference to their corresponding 'Vardesc', and 'Upvaldesc' (for upvalues) has a field 'ro' (read-only). So, it is easier to check whether a variable is read-only. The decoupling in VLOCAL between 'vidx' ('Vardesc' index) and 'sidx' (stack index) should also help the forthcoming implementation of compile-time constant propagation.
Diffstat (limited to 'lobject.h')
-rw-r--r--lobject.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/lobject.h b/lobject.h
index 403b6047..64366a94 100644
--- a/lobject.h
+++ b/lobject.h
@@ -460,6 +460,7 @@ typedef struct Upvaldesc {
460 TString *name; /* upvalue name (for debug information) */ 460 TString *name; /* upvalue name (for debug information) */
461 lu_byte instack; /* whether it is in stack (register) */ 461 lu_byte instack; /* whether it is in stack (register) */
462 lu_byte idx; /* index of upvalue (in stack or in outer function's list) */ 462 lu_byte idx; /* index of upvalue (in stack or in outer function's list) */
463 lu_byte ro; /* true if upvalue is read-only (const) */
463} Upvaldesc; 464} Upvaldesc;
464 465
465 466