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/compiler/FLINT/clos/closure.sml
 [smlnj] / sml / trunk / compiler / FLINT / clos / closure.sml

# Diff of /sml/trunk/compiler/FLINT/clos/closure.sml

revision 245, Sat Apr 17 18:47:12 1999 UTC revision 411, Fri Sep 3 00:25:03 1999 UTC
# Line 166  Line 166
167
168  (* sort according to each variable's life time etc. *)  (* sort according to each variable's life time etc. *)
169  fun sortlud0 x = Sort.sort (fn ((_,_,i : int),(_,_,j)) => (i>j)) x  fun sortlud0 x = ListMergeSort.sort (fn ((_,_,i : int),(_,_,j)) => (i>j)) x
170
171  fun sortlud1 x =  fun sortlud1 x =
172    let fun ludfud1((_,m:int,i:int),(_,n,j)) =    let fun ludfud1((_,m:int,i:int),(_,n,j)) =
173                      (i>j) orelse ((i=j) andalso (m>n))                      (i>j) orelse ((i=j) andalso (m>n))
174     in Sort.sort ludfud1 x     in ListMergeSort.sort ludfud1 x
175    end    end
176
177  fun sortlud2(l,vl) =  fun sortlud2(l,vl) =
# Line 181  Line 181
181                    (m>n) orelse ((m=n) andalso (v<w))                    (m>n) orelse ((m=n) andalso (v<w))
182
183        val nl = map (fn (u as (v,_,_)) => (u,h u,v)) l        val nl = map (fn (u as (v,_,_)) => (u,h u,v)) l
184     in map #1 (Sort.sort ludfud2 nl)     in map #1 (ListMergeSort.sort ludfud2 nl)
185    end    end
186
187  (* cut out the first n elements, returns both the header and the rest *)  (* cut out the first n elements, returns both the header and the rest *)
# Line 1123  Line 1123
1123                    in if len < limit then m(y,s,r,k)                    in if len < limit then m(y,s,r,k)
1125                   end)                   end)
1126        val clist = Sort.sort worse (foldr h [] closlist)        val clist = ListMergeSort.sort worse (foldr h [] closlist)
1127     in m(clist,[],vfree,vlen)     in m(clist,[],vfree,vlen)
1128    end    end
1129
# Line 2046  Line 2046
2046
2047
2048  (*  (*
2049   * \$Log\$   * \$Log: closure.sml,v \$
2050     * Revision 1.1  1998/05/20 18:36:49  george
2051     *   New code that avoids sharing a single closure among
2052     *   mututually recursive functions. This way, we'll no longer
2053     *   have pointers that point to the middle of a record.
2054     *                                              -- zsh
2055     *
2056   *)   *)

Legend:
 Removed from v.245 changed lines Added in v.411