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

Diff of /sml/trunk/src/cm/compile/recomp.sml

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

revision 298, Thu May 27 09:42:28 1999 UTC revision 299, Thu May 27 13:53:27 1999 UTC
# Line 85  Line 85 
85          { stat = stat, sym = sym, pids = pidset (statpid, sympid) }          { stat = stat, sym = sym, pids = pidset (statpid, sympid) }
86      end      end
87    
88      fun primitive c p = let      fun primitive (gp: GeneralParams.info) p = let
89            val c = #primconf (#param gp)
90          val e = Primitive.env c p          val e = Primitive.env c p
91          val { statpid, sympid, ctxt } = Primitive.pidInfo c p          val { statpid, sympid, ctxt } = Primitive.pidInfo c p
92      in      in
# Line 94  Line 95 
95            ctxt = ctxt }            ctxt = ctxt }
96      end      end
97    
98        fun pervasive (gp: GeneralParams.info) = let
99            val e = #pervasive (#param gp)
100        in
101            { stat = E.staticPart e, sym = E.symbolicPart e, pids = PidSet.empty }
102        end
103    
104        fun bpervasive (gp: GeneralParams.info) =
105            E.staticPart (#pervasive (#param gp))
106    
107      fun memo2envdelta { bfc, ctxt } =      fun memo2envdelta { bfc, ctxt } =
108          { stat = (BF.senvOf bfc, BF.staticPidOf bfc),          { stat = (BF.senvOf bfc, BF.staticPidOf bfc),
109            sym = (BF.symenvOf bfc, BF.lambdaPidOf bfc),            sym = (BF.symenvOf bfc, BF.lambdaPidOf bfc),
# Line 101  Line 111 
111    
112      fun dostable (i, mkenv, gp) = let      fun dostable (i, mkenv, gp) = let
113          fun load be = let          fun load be = let
114              val fnp = #fnpolicy gp              val fnp = #fnpolicy (#param gp)
115              val stable = FilenamePolicy.mkStablePath fnp (BinInfo.group i)              val stable = FilenamePolicy.mkStablePath fnp (BinInfo.group i)
116              val os = BinInfo.offset i              val os = BinInfo.offset i
117              val descr = BinInfo.describe i              val descr = BinInfo.describe i
# Line 142  Line 152 
152          case Option.map memo2envdelta (PS.recomp_look_sml (i, pids, gp)) of          case Option.map memo2envdelta (PS.recomp_look_sml (i, pids, gp)) of
153              SOME d => SOME d              SOME d => SOME d
154            | NONE => let            | NONE => let
155                  val mkBinPath = FilenamePolicy.mkBinPath (#fnpolicy gp)                  val mkBinPath =
156                        FilenamePolicy.mkBinPath (#fnpolicy (#param gp))
157                  val binpath = mkBinPath (SmlInfo.sourcepath i)                  val binpath = mkBinPath (SmlInfo.sourcepath i)
158                  val binname = AbsPath.name binpath                  val binname = AbsPath.name binpath
159                  fun delete () = OS.FileSys.remove binname handle _ => ()                  fun delete () = OS.FileSys.remove binname handle _ => ()
# Line 177  Line 188 
188                  end handle e as Interrupt.Interrupt => raise e                  end handle e as Interrupt.Interrupt => raise e
189                           | _ => NONE                           | _ => NONE
190    
191                  fun compile () = Dummy.f ()                  fun compile () =
192                        case SmlInfo.parsetree gp i of
193                            NONE => NONE
194                          | SOME (ast, source) => let
195                                val _ = Say.vsay (concat ["[compiling ",
196                                                          SmlInfo.name i, " -> ",
197                                                          binname, "...]\n"])
198                                val corenv =
199                                    Primitive.corenv (#primconf (#param gp))
200                                val cmData = PidSet.listItems pids
201                                val bfc = BF.create { runtimePid = NONE,
202                                                      splitting = true,
203                                                      cmData = cmData,
204                                                      ast = ast,
205                                                      source = source,
206                                                      senv = stat,
207                                                      symenv = sym,
208                                                      corenv = corenv }
209                                val memo = { bfc = bfc, ctxt = stat }
210                            in
211                                save bfc;
212                                PS.recomp_memo_sml (i, memo);
213                                SOME (memo2envdelta memo)
214                            end handle e as Interrupt.Interrupt => raise e
215                                     | _ => NONE
216    
217                  fun isValid x =                  fun isValid x =
218                      PidSet.equal (PidSet.addList (PidSet.empty, BF.cmDataOf x),                      PidSet.equal (PidSet.addList (PidSet.empty, BF.cmDataOf x),

Legend:
Removed from v.298  
changed lines
  Added in v.299

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