aboutsummaryrefslogtreecommitdiff
path: root/lundump.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-07-12 11:38:42 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-07-12 11:38:42 -0300
commitf6aab3ec1f111cd8d968bdcb7ca800e93b819d24 (patch)
tree4c36c418ecc9062e6d95de73457198b38b0afce9 /lundump.c
parentbe8445d7e4b6122620c428877b51a27d464253d5 (diff)
downloadlua-f6aab3ec1f111cd8d968bdcb7ca800e93b819d24.tar.gz
lua-f6aab3ec1f111cd8d968bdcb7ca800e93b819d24.tar.bz2
lua-f6aab3ec1f111cd8d968bdcb7ca800e93b819d24.zip
First implementation of constant propagation
Local constant variables initialized with compile-time constants are optimized away from the code.
Diffstat (limited to 'lundump.c')
-rw-r--r--lundump.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lundump.c b/lundump.c
index 5c0e94d6..8f2a490c 100644
--- a/lundump.c
+++ b/lundump.c
@@ -198,12 +198,11 @@ static void LoadUpvalues (LoadState *S, Proto *f) {
198 n = LoadInt(S); 198 n = LoadInt(S);
199 f->upvalues = luaM_newvectorchecked(S->L, n, Upvaldesc); 199 f->upvalues = luaM_newvectorchecked(S->L, n, Upvaldesc);
200 f->sizeupvalues = n; 200 f->sizeupvalues = n;
201 for (i = 0; i < n; i++)
202 f->upvalues[i].name = NULL;
203 for (i = 0; i < n; i++) { 201 for (i = 0; i < n; i++) {
202 f->upvalues[i].name = NULL;
204 f->upvalues[i].instack = LoadByte(S); 203 f->upvalues[i].instack = LoadByte(S);
205 f->upvalues[i].idx = LoadByte(S); 204 f->upvalues[i].idx = LoadByte(S);
206 f->upvalues[i].ro = LoadByte(S); 205 f->upvalues[i].kind = LoadByte(S);
207 } 206 }
208} 207}
209 208