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/trunk/src/compiler/TopLevel/interact/compile.sig
ViewVC logotype

Annotation of /sml/trunk/src/compiler/TopLevel/interact/compile.sig

Parent Directory Parent Directory | Revision Log Revision Log


Revision 21 - (view) (download) (as text)

1 : monnier 21 (* COPYRIGHT (c) 1996 Bell Laboratories *)
2 :     (* compile.sig *)
3 :    
4 :     signature COMPILE0 =
5 :     sig
6 :    
7 :     exception Compile of string
8 :     type lvar = Lambda.lvar
9 :     type absyn
10 :     type compInfo
11 :    
12 :     type lambda = Lambda.lexp
13 :     type pid = PersStamps.persstamp
14 :     type obj = Unsafe.Object.object
15 :     type csegments = {c0: Word8Vector.vector, cn: Word8Vector.vector list, name:string option ref}
16 :    
17 :     val debugging : bool ref
18 :    
19 :     val mkCompInfo : Source.inputSource * StaticEnv.staticEnv *
20 :     (Absyn.dec -> Absyn.dec) -> compInfo
21 :     val anyErrors: compInfo -> bool
22 :    
23 :     val parse: Source.inputSource -> Ast.dec
24 :     val parseOne: Source.inputSource -> unit -> Ast.dec option
25 :    
26 :     structure SCS : sig type staticEnv
27 :     val SC : StaticEnv.staticEnv->staticEnv
28 :     val unSC : staticEnv->StaticEnv.staticEnv
29 :     end
30 :     type pickle
31 :     type hash
32 :    
33 :     val fixityparse: {ast: Ast.dec,
34 :     compenv: StaticEnv.staticEnv,
35 :     compInfo: compInfo} ->
36 :     {ast: Ast.dec,
37 :     compenv: StaticEnv.staticEnv,
38 :     compInfo: compInfo}
39 :    
40 :     val lazycomp: {ast: Ast.dec,
41 :     compenv: StaticEnv.staticEnv,
42 :     compInfo: compInfo} ->
43 :     {ast: Ast.dec}
44 :    
45 :     val elaborate: {ast: Ast.dec,
46 :     compenv: SCS.staticEnv,
47 :     compInfo: compInfo}
48 :     -> {absyn: Absyn.dec,
49 :     newenv: SCS.staticEnv,
50 :     exportLvars: lvar list,
51 :     exportPid: pid option,
52 :     staticPid : hash,
53 :     pickle : pickle}
54 :    
55 :     val makePid: SCStaticEnv.staticEnv * SCStaticEnv.staticEnv
56 :     -> PersStamps.persstamp
57 :    
58 :     val instrument: {source: Source.inputSource,
59 :     compenv: SCS.staticEnv,
60 :     compInfo: compInfo} -> Absyn.dec -> Absyn.dec
61 :    
62 :     val translate: {absyn: Absyn.dec,
63 :     exportLvars: lvar list,
64 :     exportPid: pid option,
65 :     newstatenv : SCS.staticEnv,
66 :     oldstatenv: SCS.staticEnv,
67 :     compInfo: compInfo}
68 :     -> {genLambda: lambda option list -> lambda,
69 :     imports: pid list}
70 :    
71 :     val symDelta: pid option * lambda option -> SymbolicEnv.symenv
72 :     val architecture : string
73 :    
74 :     (* perform the inlining *)
75 :     val inline: {genLambda: lambda option list -> lambda,
76 :     imports: pid list, symenv: SymbolicEnv.symenv} -> lambda
77 :    
78 :     (* Split code in expansive code segments and an (optional) inlinable part *)
79 :     val split: {lambda: lambda, enable: bool}
80 :     -> {lambda_e: lambda, lambda_i: lambda option}
81 :    
82 :     val codegen: {lambda: lambda, compInfo: compInfo} -> csegments
83 :    
84 :     val applyCode : csegments -> obj vector -> obj
85 :    
86 :    
87 :     (* the functions above raise ONLY the exception Compile;
88 :     execute can raise other exceptions *)
89 :    
90 :     (* Isolate can raise ONLY TopLevelException or TopLevelCallcc*)
91 :    
92 :     exception TopLevelException of exn
93 :     exception SilentException (* raised by CM *)
94 :     exception TopLevelCallcc
95 :    
96 :     val isolate : ('a -> 'b) -> 'a -> 'b
97 :    
98 :     val execute: {executable: obj vector -> obj,
99 :     imports: pid list,
100 :     exportPid: pid option,
101 :     dynenv: DynamicEnv.dynenv}
102 :     -> DynamicEnv.dynenv (* new "delta" dynenv *)
103 :    
104 :     end (* signature COMPILE *)
105 :    
106 :     signature COMPILE = COMPILE0 where type SCS.staticEnv=SCStaticEnv.staticEnv
107 :     signature TOP_COMPILE = COMPILE0 where type SCS.staticEnv=StaticEnv.staticEnv
108 :    
109 :     (*
110 :     * $Log: compile.sig,v $
111 :     * Revision 1.7 1997/09/22 17:36:37 appel
112 :     * Eliminate build/topcompile.sml by merging it with build/compile.sml
113 :     *
114 :     * Revision 1.6 1997/08/25 19:20:02 riccardo
115 :     * Added support for tagging code objects with their source/bin file name.
116 :     *
117 :     * Revision 1.5 1997/08/02 02:08:36 dbm
118 :     * New top level. mkCompInfo now takes coreEnv : StaticEnv.staticEnv.
119 :     *
120 :     * Revision 1.4 1997/06/30 19:36:59 jhr
121 :     * Removed System structure; added Unsafe structure.
122 :     *
123 :     * Revision 1.3 1997/05/05 19:55:02 george
124 :     * Turning off some measurement hooks - zsh
125 :     *
126 :     * Revision 1.2 1997/03/25 13:41:42 george
127 :     * Fixing the coredump bug caused by duplicate top-level declarations.
128 :     * For example, in almost any versions of SML/NJ, typing
129 :     * val x = "" val x = 3
130 :     * would lead to core dump. This is avoided by changing the "exportLexp"
131 :     * field returned by the pickling function (pickle/picklemod.sml) into
132 :     * a list of lambdavars, and then during the pretty-printing (print/ppdec.sml),
133 :     * each variable declaration is checked to see if it is in the "exportLvars"
134 :     * list, if true, it will be printed as usual, otherwise, the pretty-printer
135 :     * will print the result as <hiddle-value>.
136 :     * -- zsh
137 :     *
138 :     *)

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