This is the mail archive of the
guile@sources.redhat.com
mailing list for the Guile project.
Re: debug evaluator is faster than regular one?
cwitty@newtonlabs.com (Carl R. Witty) writes:
> The Hugs implementation of Haskell uses a bytecode interpreter that
> uses "computed goto" when compiled with gcc and "switch" otherwise.
> It does this with a few lines of preprocessor hacks; the main body of
> the bytecode interpreter is shared between the two compilation
> variants. You might want to look how they do it.
Probably, something like the following definition is enough..
#ifdef __GNUC__
#define START
#define NEXT goto *pc++;
#define END
#else
#define START start: switch (SCM_UNPACK (*pc++)) {
#define NEXT goto start;
#define END }
#end