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.
This commit is contained in:
Roberto Ierusalimschy
2019-07-09 10:43:17 -03:00
parent e888976bc6
commit 54f7b46c1e
8 changed files with 125 additions and 131 deletions

View File

@@ -149,6 +149,7 @@ static void DumpUpvalues (const Proto *f, DumpState *D) {
for (i = 0; i < n; i++) {
DumpByte(f->upvalues[i].instack, D);
DumpByte(f->upvalues[i].idx, D);
DumpByte(f->upvalues[i].ro, D);
}
}