SCM Repository
Annotation of /sml/trunk/src/compiler/Execution/binfile/binfile.sig
Parent Directory
|
Revision Log
Revision 902 - (view) (download) (as text)
1 : | blume | 902 | (* binfile-new.sig |
2 : | * | ||
3 : | * (C) 2001 Lucent Technologies, Bell Labs | ||
4 : | * | ||
5 : | * author: Matthias Blume (blume@research.bell-labs.com | ||
6 : | *) | ||
7 : | (* | ||
8 : | * This revised version of signature BINFILE is now machine-independent. | ||
9 : | * Moreover, it deals with the file format only and does not know how to | ||
10 : | * create new binfile contents (aka "compile") or how to interpret the | ||
11 : | * pickles. As a result, it does not statically depend on the compiler. | ||
12 : | * (Eventually we might want to support a light-weight binfile loader.) | ||
13 : | *) | ||
14 : | signature BINFILE = sig | ||
15 : | |||
16 : | type bfContents | ||
17 : | |||
18 : | exception FormatError | ||
19 : | |||
20 : | type pid = PersStamps.persstamp | ||
21 : | type stats = { env: int, inlinfo: int, data: int, code: int } | ||
22 : | type pickle = { pid: pid, pickle: Word8Vector.vector } | ||
23 : | |||
24 : | val staticPidOf : bfContents -> pid | ||
25 : | val exportPidOf : bfContents -> pid option | ||
26 : | val lambdaPidOf : bfContents -> pid | ||
27 : | val cmDataOf : bfContents -> pid list | ||
28 : | |||
29 : | val senvPickleOf : bfContents -> pickle | ||
30 : | val lambdaPickleOf : bfContents -> pickle | ||
31 : | |||
32 : | (* calculate the size in bytes occupied by some binfile contents *) | ||
33 : | val size : { contents: bfContents, nopickle: bool } -> int | ||
34 : | |||
35 : | (* create the abstract binfile contents *) | ||
36 : | val create : { imports: ImportTree.import list, | ||
37 : | exportPid: pid option, | ||
38 : | cmData: pid list, | ||
39 : | senv: pickle, | ||
40 : | lambda: pickle, | ||
41 : | csegments: CodeObj.csegments } -> bfContents | ||
42 : | |||
43 : | (* read binfile contents from an IO stream *) | ||
44 : | val read : { arch: string, version: int list, | ||
45 : | name: string, stream: BinIO.instream } | ||
46 : | -> { contents: bfContents, stats: stats } | ||
47 : | |||
48 : | (* write binfile contents to an IO stream *) | ||
49 : | val write : { arch: string, version: int list, | ||
50 : | stream: BinIO.outstream, | ||
51 : | contents: bfContents, nopickle: bool } | ||
52 : | -> stats | ||
53 : | |||
54 : | (* Given a dynamic environment, link the code object contained in | ||
55 : | * some given binfile contents. The result is the delta environment | ||
56 : | * containing the bindings (if any) resulting from this link operation. *) | ||
57 : | val exec : bfContents * DynamicEnv.env -> DynamicEnv.env | ||
58 : | end |
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |