Re: Caclulating operand stack size

"Aaron Gray" <angray@beeb.net>
16 May 2005 11:21:07 -0400

          From comp.compilers

Related articles
Caclulating operand stack size clearm@comcast.net (2005-05-14)
Re: Caclulating operand stack size anton@mips.complang.tuwien.ac.at (2005-05-16)
Re: Caclulating operand stack size angray@beeb.net (Aaron Gray) (2005-05-16)
Re: Caclulating operand stack size DrDiettrich@compuserve.de (Hans-Peter Diettrich) (2005-05-18)
Re: Caclulating operand stack size anton@mips.complang.tuwien.ac.at (2005-05-18)
| List of all articles for this month |

From: "Aaron Gray" <angray@beeb.net>
Newsgroups: comp.compilers
Date: 16 May 2005 11:21:07 -0400
Organization: Compilers Central
References: 05-05-105
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)
> growStack();
>
> 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
> recall.


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.


Aaron


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.