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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2527 - (view) (download)

1 : dbm 2527 mkVBs
2 :    
3 :     case: val x = x (simple variable to variable binding)
4 :     Question: to do explice type abstraction wrapping (mkPE) or not.
5 :     - avoid type eta-expansion?
6 :     - inst param tyvars are always going to equal VB boundtvs?
7 :     - avoid using mkVar if exp is primop var, since mkVar looses
8 :     primop
9 :    
10 :    
11 :     mkExp
12 :     calls mkVE for variable expression
13 :    
14 :     mkPE
15 :     Wraps an expression with a type abstraction corresponding to
16 :     the boundtvs of a VB
17 :    
18 :    
19 :     mkVar
20 :     Translates a VALvar into default dynamic access path via mkAccInfo.
21 :     prim property is discarded.
22 :    
23 :    
24 :     mkVE(e = VALvar, ts = inst types, d=depth)
25 :     Translate variable that might be bound to a primop.
26 :    
27 :     Prim case:
28 :     (1) determines the type instantiation parameters relative
29 :     to the primop intrinsice type (intrinsicParams).
30 :     (2) case on primop: performs special immediate translations
31 :     of certain primops, supplying instantiation types: [POLYEQ,
32 :     POLYNEQ, INLMKARRAY, RAW_CCALL).
33 :     For all other primops, calls transPrim with primop, translated
34 :     intrinsic type, and translated intrinsic params.
35 :    
36 :     Nonprim case:
37 :     calls mkVar if there are no instantiation
38 :     parameters, otherwise calls mkVar and wraps result with appropriate
39 :     TAPP (type application) to translated instantiation types.
40 :    
41 :    
42 :     Control Flow
43 :    
44 :     For simple variable bindings like
45 :    
46 :     val x = y
47 :    
48 :     VB{pat=VARpat(V.VALvar{access=DA.LVAR v, ...}), (* x *)
49 :     exp as VARexp _, boundtvs=btvs, ...}, (* y *)
50 :    
51 :     The flow is:
52 :    
53 :     mkVBs --> mkPE --> mkExp -> mkVE
54 :    
55 :     mkPE wraps the rhs variable expression in an n-ary TFN abstraction,
56 :     where n = length(btvs), the polymorphically bound tyvars.
57 :    
58 :     mkVE takes care of calculating the type instantiation parameters for
59 :     primops relative to their intrinsic types.

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