[gforth] / gforth / engine / main.c  

gforth: gforth/engine/main.c

Diff for /gforth/engine/main.c between version 1.132 and 1.133

version 1.132, Sun Nov 9 11:35:23 2003 UTC version 1.133, Sun Nov 9 11:45:33 2003 UTC
Line 1058 
Line 1058 
   nbranchinfos++;    nbranchinfos++;
 }  }
   
 Cell *compile_prim1arg(PrimNum p)  Address compile_prim1arg(PrimNum p, Cell **argp)
 {  {
   Address old_code_here=code_here;    Address old_code_here=append_prim(p);
   
   assert(vm_prims[p]==priminfos[p].start);    assert(vm_prims[p]==priminfos[p].start);
   append_prim(p);    *argp = (Cell*)(old_code_here+priminfos[p].immargs[0].offset);
   return (Cell*)(old_code_here+priminfos[p].immargs[0].offset);    return old_code_here;
 }  }
   
 Cell *compile_call2(Cell targetptr)  Cell *compile_call2(Cell targetptr)
Line 1114 
Line 1114 
   
   assert(p<npriminfos);    assert(p<npriminfos);
   if (p==N_execute || p==N_perform || p==N_lit_perform) {    if (p==N_execute || p==N_perform || p==N_lit_perform) {
     next_code_target = compile_prim1arg(N_set_next_code);      codeaddr = (Cell)compile_prim1arg(N_set_next_code, &next_code_target);
   }    }
   if (p==N_call) {    if (p==N_call) {
     next_code_target = compile_call2(tcp[1]);      next_code_target = compile_call2(tcp[1]);
   } else if (p==N_does_exec) {    } else if (p==N_does_exec) {
     struct doesexecinfo *dei = &doesexecinfos[ndoesexecinfos++];      struct doesexecinfo *dei = &doesexecinfos[ndoesexecinfos++];
     *compile_prim1arg(N_lit) = (Cell)PFA(tcp[1]);      Cell *arg;
       codeaddr = compile_prim1arg(N_lit,&arg);
       *arg = (Cell)PFA(tcp[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 1129 
Line 1131 
     dei->xt = (Cell *)(tcp[1]);      dei->xt = (Cell *)(tcp[1]);
     next_code_target = compile_call2(0);      next_code_target = compile_call2(0);
   } else if (!is_relocatable(p)) {    } else if (!is_relocatable(p)) {
     next_code_target = compile_prim1arg(N_set_next_code);      Cell *branch_target;
     set_rel_target(compile_prim1arg(N_branch),vm_prims[p]);      codeaddr = compile_prim1arg(N_set_next_code, &next_code_target);
       compile_prim1arg(N_branch,&branch_target);
       set_rel_target(branch_target,vm_prims[p]);
   } else {    } else {
     unsigned j;      unsigned j;
     Address old_code_here = append_prim(p);      Address old_code_here = append_prim(p);


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

CVS Admin

Powered by ViewCVS 1.0-dev
(Powered by ViewCVS)

ViewCVS and CVS Help