[gforth] / gforth / engine / main.c  

gforth: gforth/engine/main.c

Diff for /gforth/engine/main.c between version 1.49 and 1.50

version 1.49, Thu Dec 27 16:29:29 2001 UTC version 1.50, Sat Dec 29 20:40:49 2001 UTC
Line 444 
Line 444 
   
 void check_prims(Label symbols1[])  void check_prims(Label symbols1[])
 {  {
 #ifndef DOUBLY_INDIRECT  #if defined(IS_NEXT_JUMP) && !defined(DOUBLY_INDIRECT)
   int i;    int i;
   Label *symbols2=engine2(0,0,0,0,0);    Label *symbols2=engine2(0,0,0,0,0);
   static char superend[]={    static char superend[]={
Line 460 
Line 460 
     PrimInfo *pi=&priminfos[i];      PrimInfo *pi=&priminfos[i];
     int j;      int j;
     pi->super_end = superend[i-DOESJUMP-1];      pi->super_end = superend[i-DOESJUMP-1];
     for (j=prim_len-3; ; j--) {      for (j=prim_len-IND_JUMP_LENGTH; ; j--) {
       if (((*(Cell *)(symbols1[i]+j)) & 0xfff8ff) == 0xfc60ff) {        if (IS_NEXT_JUMP(symbols1[i]+j)) {
         /* jmp -4(reg), i.e., the NEXT jump */  
         prim_len = j;          prim_len = j;
         if (pi->super_end)          if (pi->super_end)
           prim_len += 3; /* include the jump */            prim_len += IND_JUMP_LENGTH; /* include the jump */
         break;          break;
       }        }
       if (j==0) { /* NEXT jump not found, e.g., execute */        if (j==0) { /* NEXT jump not found, e.g., execute */
Line 494 
Line 493 
   
 Label compile_prim(Label prim)  Label compile_prim(Label prim)
 {  {
   #ifdef IND_JUMP_LENGTH
   int i;    int i;
   Address old_code_here=code_here;    Address old_code_here=code_here;
   static Address last_jump=0;    static Address last_jump=0;
Line 501 
Line 501 
   for (i=0; ; i++) {    for (i=0; ; i++) {
     if (i>=npriminfos) { /* not a relocatable prim */      if (i>=npriminfos) { /* 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, 3);          memcpy(code_here, last_jump, IND_JUMP_LENGTH);
         code_here += 3;          code_here += IND_JUMP_LENGTH;
         last_jump = 0;          last_jump = 0;
       }        }
       return prim;        return prim;
Line 510 
Line 510 
     if (priminfos[i].start==prim)      if (priminfos[i].start==prim)
       break;        break;
   }    }
   #ifdef ALIGN_CODE
     ALIGN_CODE;
   #endif
   memcpy(code_here, (Address)prim, priminfos[i].length);    memcpy(code_here, (Address)prim, priminfos[i].length);
   code_here += priminfos[i].length;    code_here += priminfos[i].length;
   last_jump = (priminfos[i].super_end) ? 0 : (prim+priminfos[i].length);    last_jump = (priminfos[i].super_end) ? 0 : (prim+priminfos[i].length);
   return (Label)old_code_here;    return (Label)old_code_here;
   #else
     return prim;
   #endif
 }  }
   
 Address loader(FILE *imagefile, char* filename)  Address loader(FILE *imagefile, char* filename)


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

CVS Admin

Powered by ViewCVS 1.0-dev
(Powered by ViewCVS)

ViewCVS and CVS Help