lua-users home
lua-l archive

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


Hello,

I have some questions concerning the Lua 5 virtual machine since I am 
currently designing a small vm as a students project. I read several mails 
about the vm and also shortly looked at the source code. 

1. I read that it is a register vm. How do you solve argument passing? I found 
in "src_ldo.c" a comment that argument passing is done through a stack. Is 
that correct? Do you deviate from the typical register based architecture in 
that case to save memory traffic?

2. As far as I learned you do instruction encoding close to hardware 
architectures. Therefore you always have to decode the opcode in contrast to 
the JVM where opcode and arguments are stored in several independent bytes. 
Is opcode decoding cheap (one might forgive my poor knowledge of C operator 
performance;-)?

Thanks a lot for your help!

Best regards,

 Christian