[gforth] / gforth / engine / main.c  

gforth: gforth/engine/main.c

Diff for /gforth/engine/main.c between version 1.72 and 1.73

version 1.72, Sat Dec 7 17:43:35 2002 UTC version 1.73, Sun Dec 8 09:57:54 2002 UTC
Line 81 
Line 81 
 int optind = 1;  int optind = 1;
 #endif  #endif
   
   #define CODE_BLOCK_SIZE (1024*1024)
 Address code_area=0;  Address code_area=0;
   Cell code_area_size = CODE_BLOCK_SIZE;
 Address code_here=0; /* does for code-area what HERE does for the dictionary */  Address code_here=0; /* does for code-area what HERE does for the dictionary */
 Address start_flush=0; /* start of unflushed code */  Address start_flush=0; /* start of unflushed code */
   
Line 370 
Line 372 
   header->fp_stack_base=my_alloc(fsize);    header->fp_stack_base=my_alloc(fsize);
   header->return_stack_base=my_alloc(rsize);    header->return_stack_base=my_alloc(rsize);
   header->locals_stack_base=my_alloc(lsize);    header->locals_stack_base=my_alloc(lsize);
   code_here = start_flush = code_area = my_alloc(dictsize);    code_here = start_flush = code_area = my_alloc(code_area_size);
 }  }
   
 #warning You can ignore the warnings about clobbered variables in go_forth  #warning You can ignore the warnings about clobbered variables in go_forth
Line 563 
Line 565 
   Cell *xt; /* cfa of word whose does-code needs calling */    Cell *xt; /* cfa of word whose does-code needs calling */
 } doesexecinfos[10000];  } doesexecinfos[10000];
   
 #define N_EXECUTE 10  /* definitions of N_execute etc. */
 #define N_PERFORM 11  #include "prim_num.i"
 #define N_LIT_PERFORM 337  
 #define N_CALL 333  
 #define N_DOES_EXEC 339  
 #define N_LIT 9  
 #define N_CALL2 362  
 #define N_ABRANCH 341  
 #define N_SET_NEXT_CODE 361  
   
 void set_rel_target(Cell *source, Label target)  void set_rel_target(Cell *source, Label target)
 {  {
Line 599 
Line 594 
 Cell *compile_call2(Cell targetptr)  Cell *compile_call2(Cell targetptr)
 {  {
   Cell *next_code_target;    Cell *next_code_target;
   PrimInfo *pi = &priminfos[N_CALL2];    PrimInfo *pi = &priminfos[N_call2];
   
   memcpy(code_here, pi->start, pi->length);    memcpy(code_here, pi->start, pi->length);
   next_code_target = (Cell *)(code_here + pi->immargs[0].offset);    next_code_target = (Cell *)(code_here + pi->immargs[0].offset);
Line 653 
Line 648 
     Cell *next_code_target=NULL;      Cell *next_code_target=NULL;
   
     assert(i<npriminfos);      assert(i<npriminfos);
     if (i==N_EXECUTE||i==N_PERFORM||i==N_LIT_PERFORM) {      if (i==N_execute||i==N_perform||i==N_lit_perform) {
       next_code_target = compile_prim1arg(N_SET_NEXT_CODE);        next_code_target = compile_prim1arg(N_set_next_code);
     }      }
     if (i==N_CALL) {      if (i==N_call) {
       next_code_target = compile_call2(last_start[1]);        next_code_target = compile_call2(last_start[1]);
     } else if (i==N_DOES_EXEC) {      } else if (i==N_does_exec) {
       struct doesexecinfo *dei = &doesexecinfos[ndoesexecinfos++];        struct doesexecinfo *dei = &doesexecinfos[ndoesexecinfos++];
       *compile_prim1arg(N_LIT) = (Cell)PFA(last_start[1]);        *compile_prim1arg(N_lit) = (Cell)PFA(last_start[1]);
       /* we cannot determine the callee now (last_start[1] may be a        /* we cannot determine the callee now (last_start[1] may be a
          forward reference), so just register an arbitrary target, and           forward reference), so just register an arbitrary target, and
          register in dei that we need to fix this before resolving           register in dei that we need to fix this before resolving
Line 669 
Line 664 
       dei->xt = (Cell *)(last_start[1]);        dei->xt = (Cell *)(last_start[1]);
       next_code_target = compile_call2(NULL);        next_code_target = compile_call2(NULL);
     } else if (pi->start == NULL) { /* non-reloc */      } else if (pi->start == NULL) { /* non-reloc */
       next_code_target = compile_prim1arg(N_SET_NEXT_CODE);        next_code_target = compile_prim1arg(N_set_next_code);
       set_rel_target(compile_prim1arg(N_ABRANCH),*(Xt)last_prim);        set_rel_target(compile_prim1arg(N_abranch),*(Xt)last_prim);
     } else {      } else {
       unsigned j;        unsigned j;
   


Generate output suitable for use with a patch program
Legend:
Removed from v.1.72  
changed lines
  Added in v.1.73

CVS Admin

Powered by ViewCVS 1.0-dev
(Powered by ViewCVS)

ViewCVS and CVS Help