Virtual Machine Implementation?

Lars Duening <>
13 Sep 2000 21:10:10 -0400

          From comp.compilers

Related articles
Virtual Machine Implementation? (Lars Duening) (2000-09-13)
Re: Virtual Machine Implementation? (Parzival) (2000-09-15)
Re: Virtual Machine Implementation? (2000-09-15)
| List of all articles for this month |

From: Lars Duening <>
Newsgroups: comp.compilers
Date: 13 Sep 2000 21:10:10 -0400
Organization: Federation of Independent Wizards
Keywords: architecture, interpreter, question, comment

In my spare time I am currently maintaining a program with a compiler
for a small language and a interpreter for the bytecode created by the
compiler. The interpreter implements the usual virtual stack machine.

I am now contemplating improving the virtual machine (and giving me
opportunity to rework the compiler and especially the code optimizer)
through two measures:

1. Change the basic code unit from byte to 32 bit words.

Some quick and dirty testing showed a small performance advantage if
the interpreter would access memory wordwise instead of bytewise. Only
on x86 processors bytewise access was faster, but only marginally so.

2. Change the machine design into a hybrid stack/register design.

Since the 32 bit words leave enough space to implement 3-address
instructions, it makes sense to organise the space within a stack
frame into 'registers' and address them directly. I expect that this
measure will lead to shorter codesizes and therefore to a better
performance due to the reduced number of memory accesses.

However, before I dive into this change I'd like to ask you for
opinions or pointers to papers regarding the feasability of this
approach. I have searched the web for information, but found only Java
Lars Duening;
[You might also ask this on the virtmach mailing list. Send "subscribe"
to -John]

Post a followup to this message

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