From: Jean-Hugues ROBERT Date: 2004-04-06T05:02:27+09:00 Subject: Re: is RITE stack based or register based VM? Hi, At 02:48 06/04/2004 +0900, you wrote: > For this case, I may point out that sometimes the compiler can get some > knowledge about "how deep" that stack most probably needs to be (I >suppose it > can never actually know the max depth, due to >Continuation/Blocks/eval()). > >[rolo] Do you mean that based on the information that max depth is >unknown, a stack based RITE would not be as efficient as it can be using >registers? I don't know about that. What I do know is that when the evaluation stack max depth can be determined by the compiler, it is more efficient to allocate that stack once (per ActivationRecord) and use the stack as an array with absolute indexes, instead of computing some SP at runtime. I would have to investigate more about what "register" means in modern interpretor, because the understanding I have is based on some work done by C compilers twenty years ago ;-) I may do that to see if the optimization I did implement in an interpretor a while ago is related in anyway to "registers", even thought at this point I think it is not and is more like an optimized stack based scheme. When the stack size cannot be pre-determined, I guess that the only solution is to allocate more chunks of stack slots as needed (kind of catching stack-overflow as is done by some OS). The only optimization I can think of here is to allocate bigger chuncks versus one slot at the time. Yours, Jean-Hugues ------------------------------------------------------------------------- Web: http://hdl.handle.net/1030.37/1.1 Phone: +33 (0) 4 92 27 74 17