[virtmach] Switch vs. Jump Tables?

Tom Fjellstrom tfjellstrom@home.com
Tue, 14 Nov 2000 19:21:39 -0700


"Murray, Peter C" wrote:
> 
> > From: Tom Fjellstrom [mailto:tfjellstrom@home.com]
> >
> > Well CHIP right now is implemented 2 different ways,
> > one big 'switch'style execution function and an
> > equally large function using direct threading.
> 
> Do you use the term "threading" to indicate that the VM codes are initially
> converted to function addresses prior to being first run?  Or do you mean
> you have an array of function pointers indexed by VM code that repeatedly
> gets called?

The later sounds just about right.
I have an array of lable addresses indexed by
the opcodes. all the lables are in the vm_exec function.

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