Firstly, does the J2ME JVM have an internal stack for local variables and passing parameters? If so, does anyone know its limits?
Firstly, does the J2ME JVM have an internal stack for local variables and passing parameters? If so, does anyone know its limits?
JVMs store local variables and parameters in "frames" (one frame per method-invokation). Frames can be stored on a stack, or created in a linked-list in the heap, or allocated some other way. The specification only describes the frame-concept; it does not require a particular means of implementation.
So the answer to your question may vary from phone to phone. (And frankly, you're unlikely to find anyone who'll give you an answer for a specific device, unless someone has found out by experimentation.)
You can get the JVM specification from Sun's website. (It would be worth getting the CLDC specification also, as that describes how a VM for a phone differs from a "standard" VM). It's worth a look if you're interested in the behind-the-scenes view of things.
I hope my complete inability to answer your question helps!
Graham.