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 |
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 |
|
|
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 |
|