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/SMLNJ/src/MLRISC/gc-safety/gc-liveness.sml
ViewVC logotype

Diff of /sml/branches/SMLNJ/src/MLRISC/gc-safety/gc-liveness.sml

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

revision 474, Wed Nov 10 22:59:58 1999 UTC revision 475, Wed Nov 10 22:59:58 1999 UTC
# Line 3  Line 3 
3   *)   *)
4  functor GCLiveness  functor GCLiveness
5    (structure IR : MLRISC_IR    (structure IR : MLRISC_IR
6     structure GC : GC_TYPE     structure GCMap : GC_MAP
7     structure InsnProps : INSN_PROPERTIES     structure InsnProps : INSN_PROPERTIES
8        sharing InsnProps.I = IR.I        sharing InsnProps.I = IR.I
9    ) : GC_LIVENESS =    ) : GC_LIVENESS =
# Line 12  Line 12 
12    structure IR  = IR    structure IR  = IR
13    structure C   = IR.I.C    structure C   = IR.I.C
14    structure CFG = IR.CFG    structure CFG = IR.CFG
15    structure GC  = GC    structure GC  = GCMap.GC
16    structure G   = Graph    structure G   = Graph
17    structure GCTypeMap =    structure GCTypeMap =
18       GCTypeMap(structure C = C       GCTypeMap(structure C = C
# Line 20  Line 20 
20    structure R = GCTypeMap    structure R = GCTypeMap
21    structure A = Array    structure A = Array
22    
   fun error msg = MLRiscErrorMsg.error("GCLiveness",msg)  
   
23    structure Liveness =    structure Liveness =
24        DataflowFn        DataflowFn
25           (structure CFG = CFG           (structure CFG = CFG
# Line 74  Line 72 
72    
73    fun liveness (IR as G.GRAPH cfg) =    fun liveness (IR as G.GRAPH cfg) =
74    let val an = CFG.getAnnotations IR    let val an = CFG.getAnnotations IR
75        val gcmap = case #get GC.GCMAP (CFG.getAnnotations IR) of        val gcmap = #lookup GCMap.GCMAP (CFG.getAnnotations IR)
                     SOME gcmap => gcmap  
                   | NONE => error "no gc map"  
76        val regmap = CFG.regmap IR        val regmap = CFG.regmap IR
77        val table = A.array(#capacity cfg (),{liveIn=R.empty,liveOut=R.empty})        val table = A.array(#capacity cfg (),{liveIn=R.empty,liveOut=R.empty})
78        val gclookup = Intmap.mapWithDefault (gcmap,GC.TOP)        val gclookup = Intmap.mapWithDefault (gcmap,GC.TOP)

Legend:
Removed from v.474  
changed lines
  Added in v.475

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