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 /MLRISC/trunk/amd64/staged-allocation/amd64-svid-fn.sml
ViewVC logotype

Diff of /MLRISC/trunk/amd64/staged-allocation/amd64-svid-fn.sml

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

revision 3068, Fri Jun 6 00:25:53 2008 UTC revision 3069, Fri Jun 6 07:47:53 2008 UTC
# Line 196  Line 196 
196                         end                         end
197              end              end
198    
199      (* given a parameter slot, return the C location to place the slot *)
200        fun layoutParam stepFn (paramSlot, (str, paramLocss)) = let
201                val (str', paramLocs) = SA.doStagedAllocation(str, stepFn, paramSlot)
202                in
203                  (str', paramLocs :: paramLocss)
204                end
205    
206      (* given some parameter slots, return C locations to place the slots *)
207        fun layoutParams (stepFn, str, paramSlots) = let
208                val (str, paramLocss) = List.foldl (layoutParam stepFn) (str, []) paramSlots
209                val paramCLocss = List.map (List.map cLocOfStagedAlloc) paramLocss
210                in
211                   (List.rev paramCLocss, str)
212                end
213    
214    (* given a store and some parameters, return the C locations for those parameters *)    (* given a store and some parameters, return the C locations for those parameters *)
215      fun layoutCall (str, paramTys) = let      fun layoutCall (str, paramTys) = let
216               val paramSlots = List.map slotsOfCTy paramTys
217             val callStepper = SA.mkStep CCs.callStages             val callStepper = SA.mkStep CCs.callStages
            fun doParam (paramTy, (str, paramLocss)) = let  
                   val (str', paramLocs) = SA.doStagedAllocation(str, callStepper, slotsOfCTy paramTy)  
                   in  
                      (str', List.map cLocOfStagedAlloc paramLocs :: paramLocss)  
                   end  
            val (str, paramLocss) = List.foldl doParam (str, []) paramTys  
218             in             in
219                (List.rev paramLocss, str)                layoutParams (callStepper, str, paramSlots)
220             end             end
221    
222      fun layout {conv, retTy, paramTys} = let      fun layout {conv, retTy, paramTys} = let

Legend:
Removed from v.3068  
changed lines
  Added in v.3069

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