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/CodeGen/cpscompile/spill-new.sml
ViewVC logotype

Diff of /sml/trunk/src/compiler/CodeGen/cpscompile/spill-new.sml

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

revision 1333, Thu May 22 17:12:13 2003 UTC revision 1334, Thu May 22 22:46:30 2003 UTC
# Line 792  Line 792 
792                val e  = e v'                val e  = e v'
793            in  CPS.SELECT(i, CPS.VAR v, v', CPS.BOGt, e)            in  CPS.SELECT(i, CPS.VAR v, v', CPS.BOGt, e)
794            end            end
795            | proj _ = error "SpillFn: proj"
796    
797        (*        (*
798         * generate         * generate
# Line 869  Line 870 
870                else f(emitPathReloads vl, w, e)                else f(emitPathReloads vl, w, e)
871            end            end
872    
873              (* wrappers -- make the match compiler shut up *)
874              fun s1 f (v :: vs, es) = f (v, vs, es)
875                | s1 _ _ = error "Spill: s1"
876    
877              fun e1 f ([v], w, e) = f (v, w, e)
878                | e1 _ _ = error "Spill: e1"
879    
880              fun s'1 f (vs, [e]) = f (vs, e)
881                | s'1 _ _ = error "Spill: s'1"
882    
883              fun s'2 f (vs, [x, y]) = f (vs, x, y)
884                | s'2 _ _ = error "Spill: s'2"
885    
886            (*            (*
887             * Rewrite the expression             * Rewrite the expression
888             *)             *)
889            val e =            val e =
890            case e of            case e of
891              CPS.APP(v,args) =>              CPS.APP(v,args) =>
892                 rewriteStmt(v::args, [], fn (v::args,_) => CPS.APP(v,args))                 rewriteStmt(v::args, [], s1 (fn (v, args,_) => CPS.APP(v,args)))
893            | CPS.SWITCH(v,c,es) =>            | CPS.SWITCH(v,c,es) =>
894                 rewriteStmt([v], es, fn ([v], es) => CPS.SWITCH(v, c, es))                 rewriteStmt([v], es, s1 (fn (v, _, es) => CPS.SWITCH(v, c, es)))
895            | CPS.SELECT(i,v,w,t,e) =>            | CPS.SELECT(i,v,w,t,e) =>
896                 rewrite([v], w, e, fn ([v],w,e) => CPS.SELECT(i,v,w,t,e))                 rewrite([v], w, e, e1 (fn (v,w,e) => CPS.SELECT(i,v,w,t,e)))
897            | CPS.OFFSET(i,v,w,e) =>            | CPS.OFFSET(i,v,w,e) =>
898                 rewrite([v], w, e, fn ([v],w,e) => CPS.OFFSET(i,v,w,e))                 rewrite([v], w, e, e1 (fn (v,w,e) => CPS.OFFSET(i,v,w,e)))
899            | CPS.RECORD(k,l,w,e) =>            | CPS.RECORD(k,l,w,e) =>
900                 rewriteRec(l,w,e,fn (l,w,e) => CPS.RECORD(k, l, w, e))                 rewriteRec(l,w,e,fn (l,w,e) => CPS.RECORD(k, l, w, e))
901            | CPS.SETTER(p,vl,e) =>            | CPS.SETTER(p,vl,e) =>
902                 rewriteStmt(vl,[e],fn (vl,[e]) => CPS.SETTER(p,vl,e))                 rewriteStmt(vl, [e], s'1 (fn (vl,e) => CPS.SETTER(p,vl,e)))
903            | CPS.LOOKER(p,vl,w,t,e) =>            | CPS.LOOKER(p,vl,w,t,e) =>
904                 rewrite(vl,w,e, fn (vl,w,e) => CPS.LOOKER(p,vl,w,t,e))                 rewrite(vl,w,e, fn (vl,w,e) => CPS.LOOKER(p,vl,w,t,e))
905            | CPS.ARITH(p,vl,w,t,e) =>            | CPS.ARITH(p,vl,w,t,e) =>
# Line 895  Line 909 
909            | CPS.RCC(k,l,p,vl,w,t,e) =>            | CPS.RCC(k,l,p,vl,w,t,e) =>
910                 rewrite(vl,w,e,fn (vl,w,e) => CPS.RCC(k,l,p,vl,w,t,e))                 rewrite(vl,w,e,fn (vl,w,e) => CPS.RCC(k,l,p,vl,w,t,e))
911            | CPS.BRANCH(p,vl,c,x,y) =>            | CPS.BRANCH(p,vl,c,x,y) =>
912                 rewriteStmt(vl,[x,y], fn (vl,[x,y]) => CPS.BRANCH(p,vl,c,x,y))                 rewriteStmt(vl,[x,y],
913                               s'2 (fn (vl,x,y) => CPS.BRANCH(p,vl,c,x,y)))
914            | CPS.FIX _ => error "FIX in Spill.rebuild"            | CPS.FIX _ => error "FIX in Spill.rebuild"
915    
916        in  e        in  e

Legend:
Removed from v.1333  
changed lines
  Added in v.1334

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