This is the mail archive of the guile@sources.redhat.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]