lua-users home
lua-l archive

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


Steven Johnson wrote:
> Also, since I brought up "register coalescing too complex", what will
> that account for when it's no longer NYI? Or considered otherwise, are
> there specific constructs to avoid now, if it can be helped?

This happens if too many locals are live across a branch to a side
trace. The bytecode data-flow analysis I've added yesterday should
help with this, provided the locals are actually unused in that
branch.

If that analysis fails, you can limit the impact with 'do ... end'
wrappers around lengthy calculations, which involve lots of
temporaries that go dead after that. Moving this to an extra
function may be a good idea, too.

Also: always declare temporaries in the innermost scope of their
use, preferably initializing them at the same time. This happens
to be good Lua coding style, too. Don't give in to the habit of
declaring all local variables at the top of the function (which
originates in a limitation of the ancient K&R C).

--Mike