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/compiler/FLINT/opt/lcontract.sml
ViewVC logotype

Diff of /sml/trunk/src/compiler/FLINT/opt/lcontract.sml

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

revision 732, Mon Nov 13 21:59:12 2000 UTC revision 733, Fri Nov 17 05:13:45 2000 UTC
# Line 14  Line 14 
14        structure LT = LtyExtern        structure LT = LtyExtern
15        structure FU = FlintUtil        structure FU = FlintUtil
16        structure PO = PrimOp        structure PO = PrimOp
17        structure S  = Intset        structure M  = IntHashTable
       structure M  = Intmap  
18        open FLINT        open FLINT
19  in  in
20    
# Line 46  Line 45 
45    
46  exception LContPass1  exception LContPass1
47  fun pass1 fdec =  fun pass1 fdec =
48    let val zz : (DI.depth option) Intmap.intmap = Intmap.new(32, LContPass1)    let val zz : (DI.depth option) M.hash_table = M.mkTable(32, LContPass1)
49        val add = Intmap.add zz        val add = M.insert zz
50        val get = Intmap.map zz        val get = M.lookup zz
51        val rmv = Intmap.rmv zz        fun rmv i = ignore (M.remove zz i) handle _ => ()
52        fun enter(x, d) = add(x, SOME d)        fun enter(x, d) = add(x, SOME d)
53        fun kill x = ((get x; rmv x) handle _ => ())        fun kill x = ((get x; rmv x) handle _ => ())
54        fun mark nd x =        fun mark nd x =
# Line 96  Line 95 
95           in pse e           in pse e
96          end          end
97    
98     in lpfd DI.top fdec; (cand, fn () => Intmap.clear zz)     in lpfd DI.top fdec; (cand, fn () => M.clear zz)
99    end (* pass1 *)    end (* pass1 *)
100    
101  (************************************************************************  (************************************************************************
# Line 117  Line 116 
116   if init then (fn _ => false, fn () => ()) else pass1 fdec   if init then (fn _ => false, fn () => ()) else pass1 fdec
117    
118  exception LContract  exception LContract
119  val m : (int ref * info) Intmap.intmap = Intmap.new(32, LContract)  val m : (int ref * info) M.hash_table = M.mkTable(32, LContract)
120    
121  val enter = Intmap.add m  val enter = M.insert m
122  val get = Intmap.map m  val get = M.lookup m
123  val kill = Intmap.rmv m  fun kill i = ignore (M.remove m i) handle _ => ()
124    
125  fun chkIn (v, info) = enter(v, (ref 0, info))  fun chkIn (v, info) = enter(v, (ref 0, info))
126    
# Line 382  Line 381 
381  val d = DI.top  val d = DI.top
382  val (fk, f, vts, e) = fdec  val (fk, f, vts, e) = fdec
383  in (fk, f, vts, #1 (loop e))  in (fk, f, vts, #1 (loop e))
384     before (Intmap.clear m; cleanUp())     before (M.clear m; cleanUp())
385  end (* function lcontract *)  end (* function lcontract *)
386    
387  (** run the lambda contraction twice *)  (** run the lambda contraction twice *)

Legend:
Removed from v.732  
changed lines
  Added in v.733

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