[virtmach] parrot VM?

Reuben Thomas virtmach@iecc.com
Sat, 13 Jul 2002 00:23:51 +0100 (BST)


> > Is there some other obvious reason to use a stack VM?
>
> When dynamically translating to native code at runtime it's much easier
> to generate register-based native code off a stack-based bytecode than
> it is to do it off a register-based one (or even convert back to pure
> stack-based code for some architectures which have no registers).  One
> reason for this is that the stack manipulation in the bytecode has lots
> of implicit information in it (e.g., lifetimes) that would be missing in
> register-based code.

That's interesting, I came to the opposite conclusion, i.e. that
register-based VMs have more useful implicit information. On the other
hand, my VM Mite (www.mupsych.org/~rrt/research/) does have a rather
curious register stack precisely in order to make some of this information
easier to get at quickly in a JIT compiler. Indeed, whether you think my
VM is register or stack-based is principally a matter of opinion. The
instructions are conventional 3-operand register instructions, but you can
think of them equally as referring to stack positions.

-- 
http://www.mupsych.org/~rrt/ | competent, a.  underpromoted