lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi,

Julien Hamaide wrote:
> > IMHO the patch is wrong. One needs to check that the assigned
> > variable is a new one and not a parameter. Only then can the
> > first LOADNILs be omitted. But this requires restructuring ...
> > 
> > The other option is to scrap this micro-optimization entirely.
> > IMHO it's not going to make any notable difference in speed.
> 
> In some ways, I've scrapped this micro-optimization when LOADNIL is
> first instruction with the patch, while keeping it for other case. I
> don't understand what's the difference with your solution.

Oops. On closer look, you're right. Sorry.

I've assumed a reverse diff of luaK_nil between Lua-5.1-alpha and
beta would do. But the initialization of fs->lasttarget changed.
So, the optimal fix is to set fs->lasttarget to 0 in open_func()
and just remove the check for l->pc == 0 in luaK_nil. Your patch
is functionally identical.

Bye,
     Mike