--- gforth/engine/engine.c 2007/03/04 22:39:37 1.97 +++ gforth/engine/engine.c 2007/03/18 21:46:17 1.99 @@ -225,9 +225,18 @@ extern int gforth_memcmp(const char * s1 #endif #define SUPER_CONTINUE +#ifdef ASMCOMMENT +/* an individualized asm statement so that (hopefully) gcc's optimizer + does not do cross-jumping */ +#define asmcomment(string) asm(ASMCOMMENT string) +#else +/* we don't know how to do an asm comment, so we just do an empty asm */ +#define asmcomment(string) asm("") +#endif + #ifdef GFORTH_DEBUGGING #if DEBUG -#define NAME(string) { saved_ip=ip; asm("# "string); fprintf(stderr,"%08lx depth=%3ld: "string"\n",(Cell)ip,sp0+3-sp);} +#define NAME(string) { saved_ip=ip; asmcomment(string); fprintf(stderr,"%08lx depth=%3ld: "string"\n",(Cell)ip,sp0+3-sp);} #else /* !DEBUG */ #define NAME(string) { saved_ip=ip; asm(""); } /* the asm here is to avoid reordering of following stuff above the @@ -239,7 +248,7 @@ extern int gforth_memcmp(const char * s1 #elif DEBUG # define NAME(string) {Cell __depth=sp0+3-sp; int i; fprintf(stderr,"%08lx depth=%3ld: "string,(Cell)ip,sp0+3-sp); for (i=__depth-1; i>0; i--) fprintf(stderr, " $%lx",sp[i]); fprintf(stderr, " $%lx\n",spTOS); } #else -# define NAME(string) asm("# "string); +# define NAME(string) asmcomment(string); #endif #ifdef DEBUG @@ -359,7 +368,7 @@ Label *gforth_engine(Xt *ip0, Cell *sp0, #include PRIM_LAB_I #undef INST_ADDR }; -#ifdef INCLUDE_IMAGE +#ifdef STANDALONE #define INST_ADDR(name) ((Label)&&I_##name) #include "image.i" #undef INST_ADDR @@ -395,7 +404,11 @@ Label *gforth_engine(Xt *ip0, Cell *sp0, xts[i] = symbols[i] = &routines[i]; } #endif /* defined(DOUBLY_INDIRECT) */ +#ifdef STANDALONE + return image; +#else return symbols; +#endif } #if !(defined(GFORTH_DEBUGGING) || defined(INDIRECT_THREADED) || defined(DOUBLY_INDIRECT) || defined(VM_PROFILING))