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

SCM Repository

[smlnj] Annotation of /sml/branches/primop-branch-gkuan/cm/bootstrap/mkbootlist.sml
ViewVC logotype

Annotation of /sml/branches/primop-branch-gkuan/cm/bootstrap/mkbootlist.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2787 - (view) (download)

1 : blume 337 (*
2 :     * Building the bootlist from a dependency graph...
3 :     *
4 :     * (C) 1999 Lucent Technologies, Bell Laboratories
5 :     *
6 :     * Author: Matthias Blume (blume@kurims.kyoto-u.ac.jp)
7 :     *)
8 : blume 537 local
9 : blume 879 structure PS = PersStamps
10 : blume 537 type pid = PS.persstamp
11 :     in
12 :     structure MkBootList = struct
13 : mblume 1656 datatype info =
14 :     BININFO of BinInfo.info
15 :     | SMLINFO of SmlInfo.info
16 :     fun same_info (BININFO i) (BININFO i') =
17 :     BinInfo.compare (i, i') = EQUAL
18 :     | same_info (SMLINFO i) (SMLINFO i') =
19 :     SmlInfo.compare (i, i') = EQUAL
20 :     | same_info _ _ = false
21 : blume 537 fun group listName g = let
22 :     val Nil = { l = [], ss = StableSet.empty }
23 :     fun Cons ({ x, s = NONE }, { l, ss }) = { l = x :: l, ss = ss }
24 :     | Cons ({ x, s = SOME i }, { l , ss }) =
25 :     { l = x :: l, ss = StableSet.add (ss, i) }
26 :     fun bininfo i =
27 :     case BinInfo.rts_pid i of
28 : mblume 1656 SOME p => { x = (BININFO i, "#" ^ PS.toHex p), s = NONE }
29 : blume 537 | NONE => let
30 :     val x = concat [listName (BinInfo.stablename i),
31 :     "@", Int.toString (BinInfo.offset i),
32 :     ":", BinInfo.describe i]
33 :     val s = case BinInfo.sh_mode i of
34 :     Sharing.DONTSHARE => NONE
35 :     | _ => SOME i
36 : mblume 1656 in { x = (BININFO i, x), s = s }
37 : blume 537 end
38 : mblume 1656 fun smlinfo i = { x = (SMLINFO i, listName (SmlInfo.binname i)),
39 :     s = NONE }
40 : blume 537 val arg = { bininfo = bininfo,
41 :     smlinfo = smlinfo,
42 :     Cons = Cons, Nil = Nil }
43 :     in
44 :     MkList.group arg g
45 :     end
46 :     end
47 :     end

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