Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] View of /sml/branches/primop-branch-3/compiler/DEVNOTES/Flint/translate.txt
ViewVC logotype

View of /sml/branches/primop-branch-3/compiler/DEVNOTES/Flint/translate.txt

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2527 - (download) (annotate)
Wed May 9 20:31:43 2007 UTC (13 years, 8 months ago) by dbm
File size: 1752 byte(s)
reorganized DEVNOTES, adding Flint and Primop subdirectories
mkVBs

  case: val x = x (simple variable to variable binding)
    Question: to do explice type abstraction wrapping (mkPE) or not.
      - avoid type eta-expansion?
      - inst param tyvars are always going to equal VB boundtvs?
      - avoid using mkVar if exp is primop var, since mkVar looses
        primop


mkExp
  calls mkVE for variable expression

mkPE 
  Wraps an expression with a type abstraction corresponding to
  the boundtvs of a VB


mkVar
  Translates a VALvar into default dynamic access path via mkAccInfo.
  prim property is discarded.


mkVE(e = VALvar, ts = inst types, d=depth)
  Translate variable that might be bound to a primop.

  Prim case:
    (1) determines the type instantiation parameters relative
    to the primop intrinsice type (intrinsicParams).
    (2) case on primop: performs special immediate translations
    of certain primops, supplying instantiation types: [POLYEQ,
    POLYNEQ, INLMKARRAY, RAW_CCALL).
    For all other primops, calls transPrim with primop, translated
    intrinsic type, and translated intrinsic params.

  Nonprim case:
    calls mkVar if there are no instantiation
    parameters, otherwise calls mkVar and wraps result with appropriate
    TAPP (type application) to translated instantiation types.
 

Control Flow

For simple variable bindings like 

    val x = y

    VB{pat=VARpat(V.VALvar{access=DA.LVAR v, ...}),  (* x *)
       exp as VARexp _, boundtvs=btvs, ...},         (* y *)

The flow is:

    mkVBs --> mkPE --> mkExp -> mkVE

mkPE wraps the rhs variable expression in an n-ary TFN abstraction,
where n = length(btvs), the polymorphically bound tyvars.

mkVE takes care of calculating the type instantiation parameters for
primops relative to their intrinsic types.

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