mirror of
https://github.com/lua/lua
synced 2026-09-26 16:17:11 +03:00
First implementation of constant propagation
Local constant variables initialized with compile-time constants are optimized away from the code.
This commit is contained in:
parent
be8445d7e4
commit
f6aab3ec1f
12 changed files with 249 additions and 119 deletions
|
|
@ -198,12 +198,11 @@ static void LoadUpvalues (LoadState *S, Proto *f) {
|
|||
n = LoadInt(S);
|
||||
f->upvalues = luaM_newvectorchecked(S->L, n, Upvaldesc);
|
||||
f->sizeupvalues = n;
|
||||
for (i = 0; i < n; i++)
|
||||
f->upvalues[i].name = NULL;
|
||||
for (i = 0; i < n; i++) {
|
||||
f->upvalues[i].name = NULL;
|
||||
f->upvalues[i].instack = LoadByte(S);
|
||||
f->upvalues[i].idx = LoadByte(S);
|
||||
f->upvalues[i].ro = LoadByte(S);
|
||||
f->upvalues[i].kind = LoadByte(S);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue