|Caclulating operand stack size firstname.lastname@example.org (2005-05-14)|
|Re: Caclulating operand stack size email@example.com (2005-05-16)|
|Re: Caclulating operand stack size firstname.lastname@example.org (Aaron Gray) (2005-05-16)|
|Re: Caclulating operand stack size DrDiettrich@compuserve.de (Hans-Peter Diettrich) (2005-05-18)|
|Re: Caclulating operand stack size email@example.com (2005-05-18)|
|From:||"Aaron Gray" <firstname.lastname@example.org>|
|Date:||16 May 2005 11:21:07 -0400|
|Keywords:||storage, performance, design|
|Posted-Date:||16 May 2005 11:21:07 EDT|
> I am developing a stack-based virtual machine similar to the JVM.
> Unfortunately, everytime I push or load something onto the operand
> stack, I have to do this:
> if(++SP == stackSize)
> I would like to avoid this dynamic size check because it slows things
> down. The JVM requires routines to specify a stack size limit as I
This is such a minor inefficiency and provided your stack size is a
reasonable ammount it is very unlikely to be a real problem. If you
look at other VM's you will realize that inefficiencies like this do
not matter in the grand scheme of things.
But calculating and allocating extra on a
function/method/module/class/program basis if needed would be great.
Return to the
Search the comp.compilers archives again.