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/compiler/DebugProf/profile/tprof.sml
ViewVC logotype

Diff of /sml/trunk/compiler/DebugProf/profile/tprof.sml

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

revision 4493, Sun Oct 15 02:18:10 2017 UTC revision 4494, Sun Oct 15 03:04:17 2017 UTC
# Line 107  Line 107 
107  fun clean (path as name::names) = if S.eq(name,anonSym) then names else path  fun clean (path as name::names) = if S.eq(name,anonSym) then names else path
108    | clean x = x    | clean x = x
109    
110    fun intLiteral n = NUMexp{value = IntInf.fromInt n, ty = intTy}
111    
112  fun instrumDec' mayReturnMoreThanOnce (env, compInfo) absyn =  fun instrumDec' mayReturnMoreThanOnce (env, compInfo) absyn =
113   let fun getVar name = CoreAccess.getVar env [name]   let fun getVar name = CoreAccess.getVar env [name]
114       val updateop = getVar "unboxedupdate"       val updateop = getVar "unboxedupdate"
# Line 153  Line 155 
155         let val lvar = tmpvar("indexvar",intTy,mkv)         let val lvar = tmpvar("indexvar",intTy,mkv)
156          in APPexp(VARexp(ref updateop, [ref(INSTANTIATED(intTy))]),          in APPexp(VARexp(ref updateop, [ref(INSTANTIATED(intTy))]),
157                 TUPLEexp[countarray,                 TUPLEexp[countarray,
158                  INTexp (IntInf.fromInt ccvara, intTy),                  intLiteral ccvara,
159                     APPexp(varexp addop,                     APPexp(varexp addop,
160                       TUPLEexp[APPexp(VARexp(ref subop,[ref(INSTANTIATED(intTy))]),                       TUPLEexp[
161                                 TUPLEexp[countarray,                          APPexp(VARexp(ref subop,[ref(INSTANTIATED(intTy))]),
162                                         INTexp(IntInf.fromInt ccvara,intTy)]),                                 TUPLEexp[countarray, intLiteral ccvara]),
163                                               INTexp (IntInf.fromInt 1,intTy)])])                          intLiteral 1])])
164         end         end
165    
166       val intAssTy = tupleTy[CONty(refTycon,[intTy]),intTy] --> unitTy       val intAssTy = tupleTy[CONty(refTycon,[intTy]),intTy] --> unitTy
# Line 167  Line 169 
169           let val lvar = tmpvar("indexvar",intTy, mkv)           let val lvar = tmpvar("indexvar",intTy, mkv)
170            in LETexp(VALdec[VB{pat=VARpat(lvar),            in LETexp(VALdec[VB{pat=VARpat(lvar),
171                                exp=APPexp(varexp addop,                                exp=APPexp(varexp addop,
172                                           TUPLEexp[INTexp (IntInf.fromInt ccvara,                                           TUPLEexp[intLiteral ccvara, baseexp]),
                                                           intTy),  
                                                   baseexp]),  
173                                tyvars=ref nil,                                tyvars=ref nil,
174                                boundtvs=[]}],                                boundtvs=[]}],
175                      APPexp(VARexp(ref assignop,[ref(INSTANTIATED(intTy))]),                      APPexp(VARexp(ref assignop,[ref(INSTANTIATED(intTy))]),

Legend:
Removed from v.4493  
changed lines
  Added in v.4494

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