[gforth] / gforth / kernel / comp.fs  

gforth: gforth/kernel/comp.fs

Diff for /gforth/kernel/comp.fs between version 1.39 and 1.40

version 1.39, Sat Jan 5 20:16:18 2002 UTC version 1.40, Mon Feb 4 21:25:18 2002 UTC
Line 210 
Line 210 
 ' , is compile,  ' , is compile,
 [THEN]  [THEN]
   
   defer basic-block-end ( -- )
   
   : bb-end ( -- )
       0 last-compiled ! ;
   ' bb-end is basic-block-end
   
 has? peephole [IF]  has? peephole [IF]
 : peephole-compile, ( xt -- )  
     \ compile xt, appending its code to the current dynamic superinstruction  
     compile-prim , ;  
   
   \ dynamic only
   \  : peephole-compile, ( xt -- )
   \      \ compile xt, appending its code to the current dynamic superinstruction
   \      compile-prim , ;
   
   \ static only
 \  : peephole-compile, ( xt -- )  \  : peephole-compile, ( xt -- )
 \      \ compile xt, possibly combining it with the previous compiled xt  \      \ compile xt, possibly combining it with the previous compiled xt
 \      \ into a superinstruction (static superinstructions)  \      \ into a superinstruction (static superinstructions)
Line 226 
Line 235 
 \      here last-compiled !  \      here last-compiled !
 \      dyn-compile, ;  \      dyn-compile, ;
   
   : dyn-compile! ( xt -- )
       \ compile xt, appending its code to the current dynamic superinstruction
       compile-prim last-compiled-here @ ! ;
   
   :noname ( -- )
       last-compiled @ if
           last-compiled @ dyn-compile!
           0 last-compiled !
       then ;
   is basic-block-end
   
   : static-compile, ( xt -- )
       \ compile xt, possibly combining it with the previous compiled xt
       \ into a superinstruction (static superinstructions)
       last-compiled @ ?dup if
           over peeptable peephole-opt ?dup if ( xt comb-xt )
               last-compiled ! drop EXIT
           then ( xt )
           last-compiled @ dyn-compile!
       then ( xt )
       last-compiled !
       here last-compiled-here ! 0 , ;
   
 : compile-to-prims, ( xt -- )  : compile-to-prims, ( xt -- )
     \G compile xt to use primitives (and their peephole optimization)      \G compile xt to use primitives (and their peephole optimization)
     \G instead of ","-ing the xt.      \G instead of ","-ing the xt.
Line 243 
Line 275 
         ENDOF          ENDOF
         dofield: OF >body @ POSTPONE lit+ , EXIT ENDOF          dofield: OF >body @ POSTPONE lit+ , EXIT ENDOF
     ENDCASE      ENDCASE
     peephole-compile, ;      static-compile, ;
   
 ' compile-to-prims, IS compile,  ' compile-to-prims, IS compile,
 [ELSE]  [ELSE]
Line 559 
Line 591 
     \ common factor of : and :noname      \ common factor of : and :noname
     docol: cfa,      docol: cfa,
 [THEN]  [THEN]
     0 last-compiled ! defstart ] :-hook ;      defstart ] :-hook ;
   
 : : ( "name" -- colon-sys ) \ core      colon  : : ( "name" -- colon-sys ) \ core      colon
     Header (:noname) ;      Header (:noname) ;


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

CVS Admin

Powered by ViewCVS 1.0-dev
(Powered by ViewCVS)

ViewCVS and CVS Help