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/compile/full-persstate-fn.sml
ViewVC logotype

Diff of /sml/trunk/src/cm/compile/full-persstate-fn.sml

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

revision 300, Thu May 27 22:01:36 1999 UTC revision 301, Fri May 28 09:43:39 1999 UTC
# Line 7  Line 7 
7   *)   *)
8  functor FullPersstateFn (structure MachDepVC : MACHDEP_VC) :> FULL_PERSSTATE =  functor FullPersstateFn (structure MachDepVC : MACHDEP_VC) :> FULL_PERSSTATE =
9      struct      struct
10            structure E = GenericVC.Environment
11            structure DTS = DynTStamp
12    
13            type exec_memo = { dyn: E.dynenv, dts: DTS.dts }
14    
15            val smlmap = ref (AbsPathMap.empty: exec_memo AbsPathMap.map)
16            val stablemap = ref (StableMap.empty: exec_memo StableMap.map)
17    
18          local          local
19                fun discard_value i = let
20                    val p = SmlInfo.sourcepath i
21                    val m = !smlmap
22                    val m' =
23                        #1 (AbsPathMap.remove (m, p))
24                        handle LibBase.NotFound => m
25                in
26                    smlmap := m'
27                end
28              structure RecompPersstate =              structure RecompPersstate =
29                  RecompPersstateFn (structure MachDepVC = MachDepVC                  RecompPersstateFn (structure MachDepVC = MachDepVC
30                                     val discard_code = false)                                     val discard_code = false
31                                       val discard_value = discard_value)
32          in          in
33              open RecompPersstate              open RecompPersstate
34            end
             structure E = GenericVC.Environment  
             structure DTS = DynTStamp  
35    
36              infix o' o''              infix o' o''
37              fun (f o' g) (x, y) = f (g x, y)              fun (f o' g) (x, y) = f (g x, y)
38              fun (f o'' g) (x, y, z) = f (g x, y, z)              fun (f o'' g) (x, y, z) = f (g x, y, z)
39    
             type exec_memo = { dyn: E.dynenv, dts: DTS.dts }  
   
             val smlmap = ref (AbsPathMap.empty: exec_memo AbsPathMap.map)  
             val stablemap = ref (StableMap.empty: exec_memo StableMap.map)  
   
40              datatype key =              datatype key =
41                  SML of SmlInfo.info                  SML of SmlInfo.info
42                | STABLE of BinInfo.info                | STABLE of BinInfo.info
# Line 39  Line 50 
50                  stablemap := StableMap.insert (!stablemap, i, m)                  stablemap := StableMap.insert (!stablemap, i, m)
51    
52              fun remove (SML i) =              fun remove (SML i) =
53                  smlmap := #1 (AbsPathMap.remove (!smlmap,              smlmap := #1 (AbsPathMap.remove (!smlmap, SmlInfo.sourcepath i))
                                                  SmlInfo.sourcepath i))  
54                | remove (STABLE i) =                | remove (STABLE i) =
55                  stablemap := #1 (StableMap.remove (!stablemap, i))                  stablemap := #1 (StableMap.remove (!stablemap, i))
56    
# Line 73  Line 83 
83              val exec_memo_sml = exec_memo o' SML              val exec_memo_sml = exec_memo o' SML
84              val exec_memo_stable = exec_memo o' STABLE              val exec_memo_stable = exec_memo o' STABLE
85          end          end
     end  

Legend:
Removed from v.300  
changed lines
  Added in v.301

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