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

Diff of /sml/trunk/src/compiler/FLINT/cpsopt/expand.sml

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

revision 651, Thu Jun 1 18:34:03 2000 UTC revision 733, Fri Nov 17 05:13:45 2000 UTC
# Line 5  Line 5 
5    val expand : {function: CPS.function,    val expand : {function: CPS.function,
6                  bodysize: int,                  bodysize: int,
7                  unroll: bool,                  unroll: bool,
8                  table: LtyDef.lty Intmap.intmap,                  table: LtyDef.lty IntHashTable.hash_table,
9                  afterClosure: bool, do_headers: bool,                  afterClosure: bool, do_headers: bool,
10                  click: string -> unit} -> CPS.function                  click: string -> unit} -> CPS.function
11  end (* signature EXPAND *)  end (* signature EXPAND *)
# Line 71  Line 71 
71       exception NEXPAND       exception NEXPAND
72       fun getty v =       fun getty v =
73         if type_flag         if type_flag
74         then (Intmap.map typtable v) handle _ =>         then (IntHashTable.lookup typtable v) handle _ =>
75                    (Control.Print.say ("NEXPAND: Can't find the variable "^                    (Control.Print.say ("NEXPAND: Can't find the variable "^
76                              (Int.toString v)^" in the typtable ***** \n");                              (Int.toString v)^" in the typtable ***** \n");
77                     raise NEXPAND)                     raise NEXPAND)
78         else LtyExtern.ltc_void         else LtyExtern.ltc_void
79       fun addty(f,t) = Intmap.add typtable (f,t)       fun addty(f,t) = IntHashTable.insert typtable (f,t)
80     in     in
81    
82     fun mkv(t) = let val v = LV.mkLvar()     fun mkv(t) = let val v = LV.mkLvar()
# Line 93  Line 93 
93    
94    
95   local exception Expand   local exception Expand
96         val m : info Intmap.intmap = Intmap.new(128,Expand)         val m : info IntHashTable.hash_table = IntHashTable.mkTable(128,Expand)
97         val get' = Intmap.map m         val get' = IntHashTable.lookup m
98   in    val note = Intmap.add m   in    val note = IntHashTable.insert m
99         fun get i = get' i handle Expand => Other         fun get i = get' i handle Expand => Other
100         fun discard_pass1_info() = Intmap.clear m         fun discard_pass1_info() = IntHashTable.clear m
101   end   end
102     fun getval(VAR v) = get v     fun getval(VAR v) = get v
103       | getval(LABEL v) = get v       | getval(LABEL v) = get v
# Line 265  Line 265 
265     fun substitute(args,wl,e,alpha) =     fun substitute(args,wl,e,alpha) =
266      let      let
267          exception Alpha          exception Alpha
268          val vm : value Intmap.intmap = Intmap.new(16, Alpha)          val vm: value IntHashTable.hash_table = IntHashTable.mkTable(16, Alpha)
269          fun look (v,default) = Intmap.map vm v handle Alpha => default          fun look (v,default) = getOpt (IntHashTable.find vm v, default)
270          val enter = Intmap.add vm          val enter = IntHashTable.insert vm
271          fun use(v0 as VAR v) = look(v,v0)          fun use(v0 as VAR v) = look(v,v0)
272            | use(v0 as LABEL v) = look(v,v0)            | use(v0 as LABEL v) = look(v,v0)
273            | use x = x            | use x = x

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

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