Kenneth Zadeck wrote:
The stack machine that we have in mind will be as stripped down as possible. The idea is just to get the trees in and get them back out.
When I first read the proposal, I too wondered if a register machine would be better here. I've come to the conclusion that it wouldn't be, and that a stack machine is a fine choice.
*) Unlike JVM, we're not producing something that is supposed to be immediately executable. Making hardware stack machines go fast is very hard -- TOS acts as a huge atomic operator.
*) I can well imagine more complicated gimple nodes than simple 3 address forms. A stack machine makes this kind of thing easy to extend. As Kenny says, a stack machine is an ideal way to serialize a tree.
*) The stack machine decouples the getting and putting of operands from the actual operations. Although this could lead to excessive size, that does depend on the actual encoding chosen -- something that affects both stack and register machines.
nathan -- Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC [EMAIL PROTECTED] :: http://www.planetfall.pwp.blueyonder.co.uk