lua-users home
lua-l archive

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


> Sure you can, but only if you change the Lua source. That is the code for:
>
> local a = function() end
>
> At the stage that the parser does "local a" it notices that the statement
> is complete; its job is now done. The code generation routine gets that
> statement only. It does not know an assigment to "a" follows immediately.
>
> You can't expect Lua to generate -O3 style optimized code, and it is
> something to be grateful for. What you write in Lua, you get in bytecode,
> plain and simple.
>
Sorry, what I want to know is about the code at lparser.c line 520. The comment is " fix it at stack top (for GC) ".  What dose it mean?
If we skip the call to "luaK_exp2nextreg" and keep the expdesc as VRELOCABLE as other expdesc, I think that the "MOVE" instruction can be eliminated.