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/cm-boot.sml
ViewVC logotype

Diff of /sml/trunk/src/cm/cm-boot.sml

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

revision 368, Sat Jul 3 13:05:59 1999 UTC revision 369, Sun Jul 4 12:55:20 1999 UTC
# Line 1  Line 1 
1    (*
2     * This is the module that actually puts together the contents of the
3     * structure CM that people find at the top-level.  The "real" structure
4     * CM is defined in CmHook, but it needs to be initialized at bootstrap
5     * time -- and _that_ is what's done here.
6     *
7     *   Copyright (c) 1999 by Lucent Bell Laboratories
8     *
9     * author: Matthias Blume (blume@cs.princeton.edu)
10     *)
11  functor LinkCM (structure HostMachDepVC : MACHDEP_VC) = struct  functor LinkCM (structure HostMachDepVC : MACHDEP_VC) = struct
12    
13    datatype envrequest = AUTOLOAD | BARE    datatype envrequest = AUTOLOAD | BARE
# Line 31  Line 41 
41            FullPersstateFn (structure MachDepVC = HostMachDepVC            FullPersstateFn (structure MachDepVC = HostMachDepVC
42                             val system_values = system_values)                             val system_values = system_values)
43    
44        (* Create two arguments appropriate for being passed to        (* Building "Exec" will automatically also build "Recomp" and
45         * CompileGenericFn. One instantiation of that functor         * "RecompTraversal"... *)
46         * is responsible for "recompile" traversals, the other one        local
47         * does "link" traversals. Notice how the two share the same            structure E = ExecFn (structure PS = FullPersstate)
48         * underlying state. *)        in
49        structure Recomp = RecompFn (structure PS = FullPersstate)            structure Recomp = E.Recomp
50        structure Exec = ExecFn (structure PS = FullPersstate)            structure RT = E.RecompTraversal
51              structure Exec = E.Exec
52          end
53    
       (* make the two traversals *)  
       structure RT = CompileGenericFn (structure CT = Recomp)  
54        structure ET = CompileGenericFn (structure CT = Exec)        structure ET = CompileGenericFn (structure CT = Exec)
55    
56        (* The StabilizeFn functor needs a way of converting bnodes to        (* The StabilizeFn functor needs a way of converting bnodes to
# Line 110  Line 120 
120        (* Instantiate the stabilization mechanism. *)        (* Instantiate the stabilization mechanism. *)
121        structure Stabilize =        structure Stabilize =
122            StabilizeFn (val bn2statenv = bn2statenv            StabilizeFn (val bn2statenv = bn2statenv
                        val getPid = FullPersstate.pid_fetch_sml  
123                         val recomp = recomp_runner                         val recomp = recomp_runner
124                         val transfer_state = FullPersstate.transfer_state)                         val transfer_state = FullPersstate.transfer_state)
125    
# Line 139  Line 148 
148            fun cancelAnchor a = PathConfig.cancel (pcmode, a)            fun cancelAnchor a = PathConfig.cancel (pcmode, a)
149            fun resetPathConfig () = PathConfig.reset pcmode            fun resetPathConfig () = PathConfig.reset pcmode
150    
151              fun showPending () = let
152                  fun one (s, _) = let
153                      val nss = Symbol.nameSpaceToString (Symbol.nameSpace s)
154                      val n = Symbol.name s
155                  in
156                      Say.say ["  ", nss, " ", n, "\n"]
157                  end
158              in
159                  SymbolMap.appi one (AutoLoad.getPending ())
160              end
161    
162            fun initPaths () = let            fun initPaths () = let
163                val p =                val lpcth = EnvConfig.getSet StdConfig.local_pathconfig NONE
164                    case OS.Process.getEnv "HOME" of                val p = case lpcth () of
165                        NONE => []                        NONE => []
166                      | SOME h => [OS.Path.concat (h, ".smlnj-pathconfig")]                  | SOME f => [f]
167                val p = EnvConfig.getSet StdConfig.pathcfgspec NONE :: p                val p = EnvConfig.getSet StdConfig.pathcfgspec NONE :: p
168                fun processOne f = PathConfig.processSpecFile (pcmode, f)                fun processOne f = PathConfig.processSpecFile (pcmode, f)
169                    handle _ => ()                    handle _ => ()
# Line 255  Line 275 
275                    NONE => raise Fail "CMBoot: BuiltInitDG.build"                    NONE => raise Fail "CMBoot: BuiltInitDG.build"
276                  | SOME { rts, core, pervasive, primitives, ... } => let                  | SOME { rts, core, pervasive, primitives, ... } => let
277                        fun get n = let                        fun get n = let
278                            val { stat = (s, sp), sym = (sy, syp), ctxt } =                            val { stat = (s, sp), sym = (sy, syp), ctxt, bfc } =
279                                valOf (RT.sbnode ginfo n)                                valOf (RT.sbnode ginfo n)
280                            val d = Exec.env2result (valOf (ET.sbnode ginfo n))                            val d = Exec.env2result (valOf (ET.sbnode ginfo n))
281                            val env = E.mkenv { static = s, symbolic = sy,                            val env = E.mkenv { static = s, symbolic = sy,
# Line 321  Line 341 
341                                        EnvConfig.getSet StdConfig.parse_caching,                                        EnvConfig.getSet StdConfig.parse_caching,
342                                     setAnchor = setAnchor,                                     setAnchor = setAnchor,
343                                     cancelAnchor = cancelAnchor,                                     cancelAnchor = cancelAnchor,
344                                     resetPathConfig = resetPathConfig })                                     resetPathConfig = resetPathConfig,
345                                       synchronize = SrcPath.sync,
346                                       showPending = showPending })
347    
348                    end                    end
349            end            end

Legend:
Removed from v.368  
changed lines
  Added in v.369

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