Framed Stack vs. Two Stack Architecture



Hello,

We are implementing a stack-based VM for a small interpretive
language. I am currently investigating stack architectures and would
like to better understand the advantages / dis-advantages of a
framed-stack vs. two stack approach.

I understand that the JVM architecture implements a framed-stack: one
frame per activation record (method call) with an embedded operand
stack. So essentially they have rolled the execution stack and operand
stack into one. Right?

I also understand that there are architectures (although I have been
unable to find a reference implementation for this) that maintain two
separate stacks: a execution (control) stack for function calls, and a
separate data stack for (bytecode) instruction evaluation.

The language we are implementing is dynamic in nature (dynamic typing
and alllows for on-the-fly code evaluation) so we would not have the
advantage that the JVM has in knowing the max stack depth (operand
stack) at compile time. At any point code can be evaluated on-the-fly
within a function. Which I am guessing would eliminate the
stacked-frame approach? As the frames need to be allocated to a
certain size (can't grow based upon the demands for operand stack
space).

Any thoughts on these two stack architectures would be greatly
appreciated?

Thanks

.



Relevant Pages

  • Re: Framed Stack vs. Two Stack Architecture
    ... I am currently investigating stack architectures and would ... Reference the programming language FORTH or FACTOR for information on ... So essentially they have rolled the execution stack and operand ... possibly be known is the maximum size of any particular frame size. ...
    (comp.compilers)
  • Re: Is C99 the final C? (some suggestions)
    ... You mean vague terminologies like "stack"? ... wrap whatever "spawn" mechanism you have in your language (or use some ... >> and because of Java's bignum class, it meant that exposing a widening multiply ... >> you use to determine this is just related to examining the carry flag. ...
    (comp.lang.c)
  • Re: The Promise of Forth
    ... Do you think Ada and PL/1 would be as high as they are ... They can keep a language alive at the fringes. ... still another bunch of complications when the stack holds mixed types. ... For a different data type it would have to be *completely* rewritten: ...
    (comp.lang.forth)
  • Re: FORTH levels
    ... Most working on a collaborative project do not choose the programming language they are using: it is thrust upon them by the needs of the collaboration. ... When Iverson and Hui came up with J-- in part to remove APL's special character set and make it more "user friendly" not much of a community formed around it. ... But RPN does not require a visible stack, any more than any language requires a visible stack to rebuild its semantic trees from its flat expression. ...
    (comp.lang.forth)
  • Re: [OT] PostLisp, a language experiment
    ... a preconception that there isn't a language for which longer ... > latter method in Lisp, and C and many other languages so that the code ... >> apparently no runtime checks for stack mismatches, ... > the complexity and number of stack items for each definition. ...
    (comp.lang.lisp)