Diff for /gforth/engine/main.c between versions 1.65 and 1.66

version 1.65, 2002/09/15 20:30:01 version 1.66, 2002/09/19 19:04:42
Line 86  Address code_here=0; /* does for code-ar Line 86  Address code_here=0; /* does for code-ar
 Address start_flush=0; /* start of unflushed code */  Address start_flush=0; /* start of unflushed code */
   
 static int no_super=0;   /* true if compile_prim should not fuse prims */  static int no_super=0;   /* true if compile_prim should not fuse prims */
   /* --no-dynamic by default on gcc versions >=3.1 (it works with 3.0.4,
      but not with 3.2) */
   #if (__GNUC__>2 && __GNUC_MINOR__>=1)
 static int no_dynamic=1; /* true if compile_prim should not generate code */  static int no_dynamic=1; /* true if compile_prim should not generate code */
   #else
   static int no_dynamic=0; /* true if compile_prim should not generate code */
   #endif
   
 #ifdef HAS_DEBUG  #ifdef HAS_DEBUG
 static int debug=0;  static int debug=0;
Line 454  void check_prims(Label symbols1[]) Line 460  void check_prims(Label symbols1[])
 #include "prim_superend.i"  #include "prim_superend.i"
   };    };
   
     if (debug)
   #ifdef __VERSION__
       fprintf(stderr, "Compiled with gcc-" __VERSION__ "\n");
   #else
   #define xstr(s) str(s)
   #define str(s) #s
     fprintf(stderr, "Compiled with gcc-" xstr(__GNUC__) "." xstr(__GNUC_MINOR__) "\n"); 
   #endif
   for (i=DOESJUMP+1; symbols1[i+1]!=0; i++)    for (i=DOESJUMP+1; symbols1[i+1]!=0; i++)
     ;      ;
   npriminfos = i;    npriminfos = i;
   
 #if 0 && defined(IS_NEXT_JUMP) && !defined(DOUBLY_INDIRECT)  #if defined(IS_NEXT_JUMP) && !defined(DOUBLY_INDIRECT)
     if (no_dynamic)
       return;
   symbols2=engine2(0,0,0,0,0);    symbols2=engine2(0,0,0,0,0);
   priminfos = calloc(i,sizeof(PrimInfo));    priminfos = calloc(i,sizeof(PrimInfo));
   for (i=DOESJUMP+1; symbols1[i+1]!=0; i++) {    for (i=DOESJUMP+1; symbols1[i+1]!=0; i++) {
Line 483  void check_prims(Label symbols1[]) Line 499  void check_prims(Label symbols1[])
     pi->length = prim_len;      pi->length = prim_len;
     /* fprintf(stderr,"checking primitive %d: memcmp(%p, %p, %d)\n",      /* fprintf(stderr,"checking primitive %d: memcmp(%p, %p, %d)\n",
        i, symbols1[i], symbols2[i], prim_len);*/         i, symbols1[i], symbols2[i], prim_len);*/
     if (no_dynamic||memcmp(symbols1[i],symbols2[i],prim_len)!=0) {      if (memcmp(symbols1[i],symbols2[i],prim_len)!=0) {
       if (debug)        if (debug)
         fprintf(stderr,"Primitive %d not relocatable: memcmp(%p, %p, %d)\n",          fprintf(stderr,"Primitive %d not relocatable: memcmp(%p, %p, %d)\n",
                 i, symbols1[i], symbols2[i], prim_len);                  i, symbols1[i], symbols2[i], prim_len);
Line 505  Label compile_prim(Label prim) Line 521  Label compile_prim(Label prim)
     return prim;      return prim;
   } else    } else
     return prim-((Label)xts)+((Label)vm_prims);      return prim-((Label)xts)+((Label)vm_prims);
 #elif 0 && defined(IND_JUMP_LENGTH) && !defined(VM_PROFILING) && !defined(INDIRECT_THREADED)  #elif defined(IND_JUMP_LENGTH) && !defined(VM_PROFILING) && !defined(INDIRECT_THREADED)
   unsigned i;    unsigned i;
   Address old_code_here=code_here;    Address old_code_here=code_here;
   static Address last_jump=0;    static Address last_jump=0;
   
   i = ((Xt)prim)-vm_prims;    i = ((Xt)prim)-vm_prims;
   prim = *(Xt)prim;    prim = *(Xt)prim;
     if (no_dynamic)
       return prim;
   if (i>=npriminfos || priminfos[i].start == 0) { /* not a relocatable prim */    if (i>=npriminfos || priminfos[i].start == 0) { /* not a relocatable prim */
     if (last_jump) { /* make sure the last sequence is complete */      if (last_jump) { /* make sure the last sequence is complete */
       memcpy(code_here, last_jump, IND_JUMP_LENGTH);        memcpy(code_here, last_jump, IND_JUMP_LENGTH);
Line 800  void gforth_args(int argc, char ** argv, Line 818  void gforth_args(int argc, char ** argv,
       {"debug", no_argument, &debug, 1},        {"debug", no_argument, &debug, 1},
       {"no-super", no_argument, &no_super, 1},        {"no-super", no_argument, &no_super, 1},
       {"no-dynamic", no_argument, &no_dynamic, 1},        {"no-dynamic", no_argument, &no_dynamic, 1},
         {"dynamic", no_argument, &no_dynamic, 0},
       {0,0,0,0}        {0,0,0,0}
       /* no-init-file, no-rc? */        /* no-init-file, no-rc? */
     };      };
Line 831  Engine Options:\n\ Line 850  Engine Options:\n\
   -d SIZE, --data-stack-size=SIZE   Specify data stack size\n\    -d SIZE, --data-stack-size=SIZE   Specify data stack size\n\
   --debug                           Print debugging information during startup\n\    --debug                           Print debugging information during startup\n\
   --die-on-signal                   exit instead of CATCHing some signals\n\    --die-on-signal                   exit instead of CATCHing some signals\n\
     --dynamic                         use dynamic native code\n\
   -f SIZE, --fp-stack-size=SIZE     Specify floating point stack size\n\    -f SIZE, --fp-stack-size=SIZE     Specify floating point stack size\n\
   -h, --help                        Print this message and exit\n\    -h, --help                        Print this message and exit\n\
   -i FILE, --image-file=FILE        Use image FILE instead of `gforth.fi'\n\    -i FILE, --image-file=FILE        Use image FILE instead of `gforth.fi'\n\
Line 842  Engine Options:\n\ Line 862  Engine Options:\n\
   --offset-image                    Load image at a different position\n\    --offset-image                    Load image at a different position\n\
   -p PATH, --path=PATH              Search path for finding image and sources\n\    -p PATH, --path=PATH              Search path for finding image and sources\n\
   -r SIZE, --return-stack-size=SIZE Specify return stack size\n\    -r SIZE, --return-stack-size=SIZE Specify return stack size\n\
   -v, --version                     Print version and exit\n\    -v, --version                     Print engine version and exit\n\
 SIZE arguments consist of an integer followed by a unit. The unit can be\n\  SIZE arguments consist of an integer followed by a unit. The unit can be\n\
   `b' (byte), `e' (element; default), `k' (KB), `M' (MB), `G' (GB) or `T' (TB).\n",    `b' (byte), `e' (element; default), `k' (KB), `M' (MB), `G' (GB) or `T' (TB).\n",
               argv[0]);                argv[0]);

Removed from v.1.65  
changed lines
  Added in v.1.66


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>