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/idlbasis-devel/src/MLRISC/backpatch/vlBackPatch.sml
ViewVC logotype

Diff of /sml/branches/idlbasis-devel/src/MLRISC/backpatch/vlBackPatch.sml

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

revision 1231, Mon Jun 3 18:32:08 2002 UTC revision 1232, Tue Jun 4 21:11:15 2002 UTC
# Line 23  Line 23 
23   * Indeed 96% of the  files in the compiler reach a fix point within   * Indeed 96% of the  files in the compiler reach a fix point within
24   * 13 iterations.   * 13 iterations.
25   *)   *)
 signature MC_EMIT = sig  
   structure I : INSTRUCTIONS  
   
   val emitInstr : I.instruction -> Word8Vector.vector  
 end  
   
   
26  functor BackPatch  functor BackPatch
27    (structure CodeString : CODE_STRING    (structure CodeString : CODE_STRING
28     structure Jumps      : SDI_JUMPS     structure Jumps      : SDI_JUMPS
# Line 40  Line 33 
33     structure CFG        : CONTROL_FLOW_GRAPH     structure CFG        : CONTROL_FLOW_GRAPH
34                          where I = Emitter.I                          where I = Emitter.I
35     structure Asm        : INSTRUCTION_EMITTER     structure Asm        : INSTRUCTION_EMITTER
36                          where I = CFG.I                          where I = CFG.I) =
    structure Placement  : BLOCK_PLACEMENT  
                         where CFG = CFG)  : BBSCHED =  
37  struct  struct
38    structure I   = Jumps.I    structure I   = Jumps.I
39    structure C   = I.C    structure C   = I.C
# Line 60  Line 51 
51    
52    datatype cluster = CLUSTER of {cluster: desc}    datatype cluster = CLUSTER of {cluster: desc}
53    
54    val maxIter = MLRiscControl.getInt "variable-length-backpatch-iterations"    val maxIter = MLRiscControl.mkInt
55                        ("variable-length-backpatch-iterations",
56                         "number of variable-length backpath iterations")
57    
58    val _ = maxIter := 40    val _ = maxIter := 40
59    
60    fun error msg = MLRiscErrorMsg.error("vlBackPatch",msg)    fun error msg = MLRiscErrorMsg.error("vlBackPatch",msg)
# Line 69  Line 63 
63    val dataList : P.pseudo_op list ref = ref []    val dataList : P.pseudo_op list ref = ref []
64    fun cleanUp() = (clusterList := []; dataList := [])    fun cleanUp() = (clusterList := []; dataList := [])
65    
66    fun bbsched(cfg as G.GRAPH{graph_info=CFG.INFO{data, ...}, ...}) = let    fun bbsched(G.GRAPH{graph_info=CFG.INFO{data, ...}, ...}, blocks) = let
     val blocks = map #2 (Placement.blockPlacement cfg)  
67      fun bytes([], p) = p      fun bytes([], p) = p
68        | bytes([s], p) = BYTES(s, p)        | bytes([s], p) = BYTES(s, p)
69        | bytes(s, p) = BYTES(W8V.concat s, p)        | bytes(s, p) = BYTES(W8V.concat s, p)
70    
71      fun f(CFG.BLOCK{align, labels, insns, ...}::rest) = let      fun f((_, CFG.BLOCK{align, labels, insns, ...})::rest) = let
72           fun instrs([], b) = bytes(rev b, f rest)           fun instrs([], b) = bytes(rev b, f rest)
73             | instrs(i::rest, b) =             | instrs(i::rest, b) =
74               if Jumps.isSdi i then               if Jumps.isSdi i then

Legend:
Removed from v.1231  
changed lines
  Added in v.1232

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