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/x86/staged-allocation/ia32-vararg-ccall-fn.sml
ViewVC logotype

Diff of /MLRISC/trunk/x86/staged-allocation/ia32-vararg-ccall-fn.sml

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

revision 3067, Thu Jun 5 22:18:34 2008 UTC revision 3068, Fri Jun 6 00:25:53 2008 UTC
# Line 50  Line 50 
50    
51      fun genVarargs () = let      fun genVarargs () = let
52             val lab = Label.global "varargs"             val lab = Label.global "varargs"
53             val args = C.newReg()             val argsReg = C.newReg()
            val cFun = C.newReg()  
54          (* we align the frame to a 16-bytes to support Mac OS. *)          (* we align the frame to a 16-bytes to support Mac OS. *)
55             val frameSzB = 1024*4-2*4             val frameSzB = 1024*4-2*4
56             val endOfArgs = raise Fail "todo"             val cFun = getArg 0
57               val endOfArgs = getArg 2
58             in             in
59                (lab,                (lab,
60                 List.concat [                 List.concat [
61                     [T.LIVE CCall.CCs.calleeSaveRegs],                     [T.LIVE CCall.CCs.calleeSaveRegs],
62                     [push (T.REG(wordTy, C.ebp)),                     [push (T.REG(wordTy, C.ebp)),
63                      T.COPY (wordTy, [C.ebp], [C.esp])],                      T.COPY (wordTy, [C.ebp], [C.esp])],
64                     [T.MV(wordTy, cFun, getArg 0)],                     [T.MV(wordTy, argsReg, getArg 1)],
                    [T.MV(wordTy, args, getArg 1)],  
65                   (* allocate stack space for the arguments *)                   (* allocate stack space for the arguments *)
66                     [T.MV(wordTy, C.esp, T.SUB(wordTy, T.REG(wordTy, C.esp), lit frameSzB))],                     [T.MV(wordTy, C.esp, T.SUB(wordTy, T.REG(wordTy, C.esp), lit frameSzB))],
67                     VarargCCall.genVarargs (T.REG(wordTy, cFun), args, endOfArgs),                     VarargCCall.genVarargs (cFun, argsReg, endOfArgs),
68                     [leave],                     [leave],
69                     [T.LIVE CCall.CCs.calleeSaveRegs],                     [T.LIVE CCall.CCs.calleeSaveRegs],
70                     [T.RET []]                     [T.RET []]

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

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