version 1.94, 2006/10/27 21:47:02
|
version 1.99, 2007/03/18 21:46:17
|
Line 1
|
Line 1
|
/* Gforth virtual machine (aka inner interpreter) |
/* Gforth virtual machine (aka inner interpreter) |
|
|
Copyright (C) 1995,1996,1997,1998,2000,2003,2004,2005 Free Software Foundation, Inc. |
Copyright (C) 1995,1996,1997,1998,2000,2003,2004,2005,2006 Free Software Foundation, Inc. |
|
|
This file is part of Gforth. |
This file is part of Gforth. |
|
|
Line 54
|
Line 54
|
#include "fnmatch.h" |
#include "fnmatch.h" |
#endif |
#endif |
#else |
#else |
#include "systypes.h" |
/* #include <systypes.h> */ |
#endif |
#endif |
|
|
#if defined(HAVE_LIBDL) || defined(HAVE_DLOPEN) /* what else? */ |
#if defined(HAVE_LIBDL) || defined(HAVE_DLOPEN) /* what else? */ |
Line 225 extern int gforth_memcmp(const char * s1
|
Line 225 extern int gforth_memcmp(const char * s1
|
#endif |
#endif |
#define SUPER_CONTINUE |
#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 |
#ifdef GFORTH_DEBUGGING |
#if DEBUG |
#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 */ |
#else /* !DEBUG */ |
#define NAME(string) { saved_ip=ip; asm(""); } |
#define NAME(string) { saved_ip=ip; asm(""); } |
/* the asm here is to avoid reordering of following stuff above the |
/* the asm here is to avoid reordering of following stuff above the |
Line 239 extern int gforth_memcmp(const char * s1
|
Line 248 extern int gforth_memcmp(const char * s1
|
#elif DEBUG |
#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); } |
# 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 |
#else |
# define NAME(string) asm("# "string); |
# define NAME(string) asmcomment(string); |
#endif |
#endif |
|
|
#ifdef DEBUG |
#ifdef DEBUG |
Line 359 Label *gforth_engine(Xt *ip0, Cell *sp0,
|
Line 368 Label *gforth_engine(Xt *ip0, Cell *sp0,
|
#include PRIM_LAB_I |
#include PRIM_LAB_I |
#undef INST_ADDR |
#undef INST_ADDR |
}; |
}; |
|
#ifdef STANDALONE |
|
#define INST_ADDR(name) ((Label)&&I_##name) |
|
#include "image.i" |
|
#undef INST_ADDR |
|
#endif |
#ifdef CPU_DEP2 |
#ifdef CPU_DEP2 |
CPU_DEP2 |
CPU_DEP2 |
#endif |
#endif |
Line 390 Label *gforth_engine(Xt *ip0, Cell *sp0,
|
Line 404 Label *gforth_engine(Xt *ip0, Cell *sp0,
|
xts[i] = symbols[i] = &routines[i]; |
xts[i] = symbols[i] = &routines[i]; |
} |
} |
#endif /* defined(DOUBLY_INDIRECT) */ |
#endif /* defined(DOUBLY_INDIRECT) */ |
|
#ifdef STANDALONE |
|
return image; |
|
#else |
return symbols; |
return symbols; |
|
#endif |
} |
} |
|
|
#if !(defined(GFORTH_DEBUGGING) || defined(INDIRECT_THREADED) || defined(DOUBLY_INDIRECT) || defined(VM_PROFILING)) |
#if !(defined(GFORTH_DEBUGGING) || defined(INDIRECT_THREADED) || defined(DOUBLY_INDIRECT) || defined(VM_PROFILING)) |