Forth like interpreter

Christian Tismer tismer at
Tue Mar 14 15:20:03 CET 2000

Greg Ewing wrote:
> Christian Tismer wrote:
> >
> > The real "overhead" is the check on default (cmp eax, 140)
> In principle, this check could be eliminated by making the
> jump table have a full 256 entries and filling the unused
> ones with pointers to the default branch.

You bet, I tried everything I could think of to convince
this dummy that there is no need for checking. Casted
forth to byte and back... nothing but extra operations
were introduced, and then the check was inserted. VC++
seems to have one single pattern for how to do that.

Dead end, since I shouldn't use the "A"-word on c.l.p. :-)

> Whether any C compiler could be persuaded to do this I don't
> know. What about writing the switch statement with explicit
> cases for all the unused opcodes? Seems like it should work,
> unless the compiler is trying to be just *too* smart...

Tried it. VC++ doesn't use my hints. No effect but an increased
jump index table.

ciao - chris

Christian Tismer             :^)   <mailto:tismer at>
Applied Biometrics GmbH      :     Have a break! Take a ride on Python's
Kaunstr. 26                  :    *Starship*
14163 Berlin                 :     PGP key ->
PGP Fingerprint       E182 71C7 1A9D 66E9 9D15  D3CC D4D7 93E2 1FAE F6DF
     we're tired of banana software - shipped green, ripens at home

More information about the Python-list mailing list