lua-users home
lua-l archive

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


> The interesting question is, whether functions calls will be build
> up within the "registers" or at L->top ;-)

At registers, but at consecutive registers; when the call happens,
L->top is corrected to the register with the last argument (as it is now).


> I guess something like "OP_MOVE src,dest" will be the most used one
> afterwards ;-)

No, because most opcodes can get (and set) its values directly from locals. 
CALL is one of the few exceptions (as the arguments must be in order). 
OP_MOVE will be use mainly when (1) you pass a simple local as argument, 
(2) when you assign a function call to a local, (3) when you assign a 
simple local to another local. 


> But I guess a lot of work on the code generator, especially when trying to 
> optimize the creation of argument lists for function calls (I think a lot 
> of opcodes are just doing that). 

Not that much (I hope to be able to release something soon). One nice
thing is that it is not difficult to do some basic optimizations, but
the opcodes are flexible enough to allow other "heavier" optimizations.
(With a stack machine, most optimizations implied a new opcode for it.)


> Hmm... but 3 addresses for 16 bit instructions would be a little bit
> difficult.

Yes. Maybe we will give up 16 bit instructions. (Or, to avoid longs, maybe 
an instruction can be used as a record with two ints, instead of a long). 

-- Roberto