Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/cm/stable/stabilize.sml
ViewVC logotype

Diff of /sml/trunk/src/cm/stable/stabilize.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 356, Sun Jun 27 11:51:16 1999 UTC revision 357, Mon Jun 28 08:46:30 1999 UTC
# Line 13  Line 13 
13      structure SM = GenericVC.SourceMap      structure SM = GenericVC.SourceMap
14      structure GP = GeneralParams      structure GP = GeneralParams
15      structure E = GenericVC.Environment      structure E = GenericVC.Environment
16        structure Pid = GenericVC.PersStamps
17    
18      type statenvgetter = GP.info -> DG.bnode -> E.staticEnv      type statenvgetter = GP.info -> DG.bnode -> E.staticEnv
19      type recomp = GP.info -> GG.group -> bool      type recomp = GP.info -> GG.group -> bool
20        type pid = Pid.persstamp
21  in  in
22    
23  signature STABILIZE = sig  signature STABILIZE = sig
# Line 30  Line 32 
32  end  end
33    
34  functor StabilizeFn (val bn2statenv : statenvgetter  functor StabilizeFn (val bn2statenv : statenvgetter
35                         val getPid : SmlInfo.info -> pid option
36                         val warmup : BinInfo.info * pid -> unit
37                       val recomp: recomp) :> STABILIZE = struct                       val recomp: recomp) :> STABILIZE = struct
38    
39      datatype pitem =      datatype pitem =
# Line 273  Line 277 
277                      "b" :: w_int n (w_symbol sy k) m                      "b" :: w_int n (w_symbol sy k) m
278                  end                  end
279    
280                fun w_pid p = w_string (Byte.bytesToString (Pid.toBytes p))
281    
282              fun w_sn_raw (DG.SNODE n) k =              fun w_sn_raw (DG.SNODE n) k =
283                  w_si (#smlinfo n)                  w_option w_pid (getPid (#smlinfo n))
284                             (w_si (#smlinfo n)
285                       (w_list w_sn (#localimports n)                       (w_list w_sn (#localimports n)
286                               (w_list w_fsbn (#globalimports n) k))                                         (w_list w_fsbn (#globalimports n) k)))
287    
288              and w_sn n = w_share w_sn_raw PSN n              and w_sn n = w_share w_sn_raw PSN n
289    
# Line 460  Line 467 
467              val m = ref IntBinaryMap.empty              val m = ref IntBinaryMap.empty
468              val next = ref 0              val next = ref 0
469    
470                val pset = ref PidSet.empty
471    
472              fun bytesIn n = let              fun bytesIn n = let
473                  val bv = BinIO.inputN (s, n)                  val bv = BinIO.inputN (s, n)
474              in              in
# Line 628  Line 637 
637                      end                      end
638                    | _ => raise Format                    | _ => raise Format
639    
640                fun r_pid () = Pid.fromBytes (Byte.stringToBytes (r_string ()))
641    
642              (* this is the place where what used to be an              (* this is the place where what used to be an
643               * SNODE changes to a BNODE! *)               * SNODE changes to a BNODE! *)
644              fun r_sn_raw () =              fun r_sn_raw () = let
645                  DG.BNODE { bininfo = r_si (),                  val popt = r_option r_pid ()
646                    val i = r_si ()
647                    val n = DG.BNODE { bininfo = i,
648                             localimports = r_list r_sn (),                             localimports = r_list r_sn (),
649                             globalimports = r_list r_fsbn () }                             globalimports = r_list r_fsbn () }
650                in
651                    case popt of
652                        NONE => n
653                      | SOME p => (warmup (i, p); n)
654                end
655    
656              and r_sn () =              and r_sn () =
657                  r_share r_sn_raw UBN (fn (UBN n) => n | _ => raise Format) ()                  r_share r_sn_raw UBN (fn (UBN n) => n | _ => raise Format) ()

Legend:
Removed from v.356  
changed lines
  Added in v.357

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0