[virtmach] First VM

Tom Fjellstrom tfjellstrom@home.com
Mon, 13 Nov 2000 18:49:47 -0700


Nicolás Ojeda Bär wrote:
> 
> Hi,
> 
> I compiled it and tried it out, and found it quite good .. =].

:) thanks.

> One thing that I would have done different is the implementation of the
> execute loop: instead of a giant switch statement, I would have used a
> jump table indexed by opcodes pointing to function pointers implementing
> each one of the instruction. These functions would receive a pointer to
> a VM structure and modify its registers and data accordingly ...

I just finished ripping out that massive switch statement and put in
place
a direct threaded implementation using a table of labels and goto.
but now the new version is irreversibly GCC only...

It made it 13% faster :)

> HTH,
> 
> Nicolás
> 

-- 
Tom Fjellstrom
tfjellstrom@home.com
http://strangesoft.net/