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/branches/primop-branch-2/src/compiler/FLINT/trans/translate.sml
ViewVC logotype

Diff of /sml/branches/primop-branch-2/src/compiler/FLINT/trans/translate.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 174  Line 174 
174    
175  (** hashkey of accesspath + accesspath + resvar *)  (** hashkey of accesspath + accesspath + resvar *)
176  type info = (key * int list * lvar)  type info = (key * int list * lvar)
177  val hashtable : info list Intmap.intmap = Intmap.new(32,HASHTABLE)  val hashtable : info list IntHashTable.hash_table =
178        IntHashTable.mkTable(32,HASHTABLE)
179  fun hashkey l = foldr (fn (x,y) => ((x * 10 + y) mod 1019)) 0 l  fun hashkey l = foldr (fn (x,y) => ((x * 10 + y) mod 1019)) 0 l
180    
181  fun buildHdr v =  fun buildHdr v =
182    let val info = Intmap.map hashtable v    let val info = IntHashTable.lookup hashtable v
183        fun h((_, l, w), hdr) =        fun h((_, l, w), hdr) =
184               let val le = foldl (fn (k,e) => SELECT(k,e)) (VAR v) l               let val le = foldl (fn (k,e) => SELECT(k,e)) (VAR v) l
185                in fn e => hdr(LET(w, le, e))                in fn e => hdr(LET(w, le, e))
# Line 188  Line 189 
189    
190  fun bindvar (v, [], _) =  v  fun bindvar (v, [], _) =  v
191    | bindvar (v, l, nameOp) =    | bindvar (v, l, nameOp) =
192        let val info = (Intmap.map hashtable v) handle _ => []        let val info = (IntHashTable.lookup hashtable v) handle _ => []
193            val key = hashkey l            val key = hashkey l
194            fun h [] =            fun h [] =
195                  let val u = mkvN nameOp                  let val u = mkvN nameOp
196                   in Intmap.add hashtable (v,(key,l,u)::info); u                   in IntHashTable.insert hashtable (v,(key,l,u)::info); u
197                  end                  end
198              | h((k',l',w)::r) =              | h((k',l',w)::r) =
199                  if (k' = key) then (if (l'=l) then w else h r) else h r                  if (k' = key) then (if (l'=l) then w else h r) else h r

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