Diff for /gforth/engine/main.c between versions 1.147 and 1.148

version 1.147, 2005/01/22 22:16:59 version 1.148, 2005/01/23 09:55:13
Line 212  const char const* const prim_names[]={ Line 212  const char const* const prim_names[]={
 #include PRIM_NAMES_I  #include PRIM_NAMES_I
 };  };
   
   void init_ss_cost(void);
   
 static int is_relocatable(int p)  static int is_relocatable(int p)
 {  {
   return !no_dynamic && priminfos[p].start != NULL;    return !no_dynamic && priminfos[p].start != NULL;
Line 841  void check_prims(Label symbols1[]) Line 843  void check_prims(Label symbols1[])
   if (memcmp(goto_p[0],symbols2[goto_p-symbols1],goto_len)!=0) { /* unequal */    if (memcmp(goto_p[0],symbols2[goto_p-symbols1],goto_len)!=0) { /* unequal */
     no_dynamic=1;      no_dynamic=1;
     debugp(stderr,"  not relocatable, disabling dynamic code generation\n");      debugp(stderr,"  not relocatable, disabling dynamic code generation\n");
       init_ss_cost();
     return;      return;
   }    }
   goto_start = goto_p[0];    goto_start = goto_p[0];
Line 1259  struct { Line 1262  struct {
   { cost_nexts,    "nexts",    0 }    { cost_nexts,    "nexts",    0 }
 };  };
   
   #ifndef NO_DYNAMIC
   void init_ss_cost(void) {
     if (no_dynamic && ss_cost == cost_codesize) {
       ss_cost = cost_nexts;
       cost_sums[0] = cost_sums[1]; /* don't use cost_codesize for print-metrics */
       debugp(stderr, "--no-dynamic conflicts with --ss-min-codesize, reverting to --ss-min-nexts\n");
     }
   }
   #endif
   
 #define MAX_BB 128 /* maximum number of instructions in BB */  #define MAX_BB 128 /* maximum number of instructions in BB */
 #define INF_COST 1000000 /* infinite cost */  #define INF_COST 1000000 /* infinite cost */
 #define CANONICAL_STATE 0  #define CANONICAL_STATE 0
Line 1901  int main(int argc, char **argv, char **e Line 1914  int main(int argc, char **argv, char **e
 #ifdef HAS_OS  #ifdef HAS_OS
   gforth_args(argc, argv, &path, &imagename);    gforth_args(argc, argv, &path, &imagename);
 #ifndef NO_DYNAMIC  #ifndef NO_DYNAMIC
   if (no_dynamic && ss_cost == cost_codesize) {    init_ss_cost();
     ss_cost = cost_nexts;  
     cost_sums[0] = cost_sums[1]; /* don't use cost_codesize for print-metrics */  
     debugp(stderr, "--no-dynamic conflicts with --ss-min-codesize, reverting to --ss-min-nexts\n");  
   }  
 #endif /* !defined(NO_DYNAMIC) */  #endif /* !defined(NO_DYNAMIC) */
 #endif /* defined(HAS_OS) */  #endif /* defined(HAS_OS) */
   

Removed from v.1.147  
changed lines
  Added in v.1.148


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