From 54f7b46c1e8a0188e1649046a3a72522f2d769f4 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 9 Jul 2019 10:43:17 -0300 Subject: 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. --- lobject.h | 1 + 1 file changed, 1 insertion(+) (limited to 'lobject.h') 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 { TString *name; /* upvalue name (for debug information) */ lu_byte instack; /* whether it is in stack (register) */ lu_byte idx; /* index of upvalue (in stack or in outer function's list) */ + lu_byte ro; /* true if upvalue is read-only (const) */ } Upvaldesc; -- cgit v1.2.3-55-g6feb