Turn loads from immutable upvalues into constants.

This commit is contained in:
Mike Pall
2012-07-20 18:54:52 +02:00
parent 834ff6d36d
commit 3636a720a5
6 changed files with 72 additions and 24 deletions

View File

@@ -163,8 +163,9 @@ GCfunc *lj_func_newL_gc(lua_State *L, GCproto *pt, GCfuncL *parent)
for (i = 0; i < nuv; i++) {
uint32_t v = proto_uv(pt)[i];
GCupval *uv;
if ((v & 0x8000)) {
if ((v & PROTO_UV_LOCAL)) {
uv = func_finduv(L, base + (v & 0xff));
uv->immutable = ((v / PROTO_UV_IMMUTABLE) & 1);
uv->dhash = (uint32_t)(uintptr_t)mref(parent->pc, char) ^ (v << 24);
} else {
uv = &gcref(puv[v])->uv;