[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: LuaJIT2 vs. vararg
- From: Mark Hamburg <mark@...>
- Date: Tue, 24 Nov 2009 18:59:52 -0800
Does it make sense for LuaJIT to recognize certain special cases for varargs in actual traces -- e.g., 0 arguments and 1 argument? I'm thinking this would be a useful compromise for generic code.
For example, the following function would probably optimize well in practice if not in the general case:
function broadcast( array, msg, ... )
for i = 1, #array do
local obj = array[ i ]
pcall( obj[ msg ], obj, ... )
end
end
Mark