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/compiler/Semant/pickle/pickmod-new.sml
ViewVC logotype

Diff of /sml/trunk/src/compiler/Semant/pickle/pickmod-new.sml

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

revision 1057, Fri Feb 8 17:31:02 2002 UTC revision 1058, Fri Feb 8 20:02:56 2002 UTC
# Line 51  Line 51 
51                      { hash: PersStamps.persstamp,                      { hash: PersStamps.persstamp,
52                        pickle: Word8Vector.vector,                        pickle: Word8Vector.vector,
53                        exportLvars: Access.lvar list,                        exportLvars: Access.lvar list,
54                        exportPid: PersStamps.persstamp option }                        hasExports: bool }
55    
56      val pickleFLINT: FLINT.prog option -> { hash: PersStamps.persstamp,      val pickleFLINT: FLINT.prog option -> { hash: PersStamps.persstamp,
57                                              pickle: Word8Vector.vector }                                              pickle: Word8Vector.vector }
# Line 61  Line 61 
61      val pickle2hash: Word8Vector.vector -> PersStamps.persstamp      val pickle2hash: Word8Vector.vector -> PersStamps.persstamp
62    
63      val dontPickle :      val dontPickle :
64          StaticEnv.staticEnv * int          { env: StaticEnv.staticEnv, count: int } ->
65                    -> StaticEnv.staticEnv * PersStamps.persstamp *          { newenv: StaticEnv.staticEnv, hash: PersStamps.persstamp,
66                       Access.lvar list * PersStamps.persstamp option            exportLvars: Access.lvar list, hasExports: bool }
67  end  end
68    
69  local  local
# Line 1200  Line 1200 
1200          val pickle = Byte.stringToBytes (PU.pickle emptyMap (pickler e))          val pickle = Byte.stringToBytes (PU.pickle emptyMap (pickler e))
1201          val exportLvars = rev (!lvlist)          val exportLvars = rev (!lvlist)
1202          val hash = pickle2hash pickle          val hash = pickle2hash pickle
1203          val exportPid =          val hasExports = not (List.null exportLvars)
             case exportLvars of  
                 [] => NONE  
               | _ => SOME hash  
1204      in      in
1205          addPickles (Word8Vector.length pickle);          addPickles (Word8Vector.length pickle);
1206          { hash = hash, pickle = pickle, exportLvars = exportLvars,          { hash = hash, pickle = pickle, exportLvars = exportLvars,
1207            exportPid = exportPid }            hasExports = hasExports }
1208      end      end
1209    
1210      (* the dummy environment pickler *)      (* the dummy environment pickler *)
1211      fun dontPickle (senv : StaticEnv.staticEnv, count) = let      fun dontPickle { env = senv, count } = let
1212          val hash = let          val hash = let
1213              val toByte = Word8.fromLargeWord o Word32.toLargeWord              val toByte = Word8.fromLargeWord o Word32.toLargeWord
1214              val >> = Word32.>>              val >> = Word32.>>
# Line 1284  Line 1281 
1281                  end                  end
1282                | binding => (i, StaticEnv.bind (sym, binding, env), lvars)                | binding => (i, StaticEnv.bind (sym, binding, env), lvars)
1283          val (_,newenv,lvars) = foldl mapbinding (0, StaticEnv.empty, nil) syms          val (_,newenv,lvars) = foldl mapbinding (0, StaticEnv.empty, nil) syms
1284          val exportPid =          val hasExports = not (List.null lvars)
             case lvars of  
                 [] => NONE  
               | _ => SOME hash  
1285      in      in
1286          (newenv, hash, rev lvars, exportPid)          { newenv = newenv, hash = hash,
1287              exportLvars = rev lvars, hasExports = hasExports }
1288      end      end
1289    end    end
1290  end  end

Legend:
Removed from v.1057  
changed lines
  Added in v.1058

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