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/src/compiler/TopLevel/batch/binfile.sig
ViewVC logotype

Diff of /sml/trunk/src/compiler/TopLevel/batch/binfile.sig

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

revision 878, Wed Jul 18 17:43:27 2001 UTC revision 879, Thu Jul 19 18:59:38 2001 UTC
# Line 1  Line 1 
1  (* COPYRIGHT (c) 1997 Bell Labs, Lucent Technologies *)  (* binfile-new.sig
2  (* binfile.sig *)   *
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  signature BINFILE = sig
15    
16      exception FormatError      type bfContents
   
     exception Compile of string  
     exception TopLevelException of exn  
     exception SilentException  
17    
18      type bfContent      exception FormatError
19    
20      type pid = PersStamps.persstamp      type pid = PersStamps.persstamp
     type senv = StaticEnv.staticEnv  
     type symenv = SymbolicEnv.symenv  
     type denv = DynamicEnv.dynenv  
     type env = Environment.environment  
   
     val staticPidOf: bfContent -> pid  
     val exportPidOf: bfContent -> pid option  
     val lambdaPidOf: bfContent -> pid  
     val cmDataOf: bfContent -> pid list  
     val senvOf: bfContent -> senv  
     val symenvOf: bfContent -> symenv  
   
     val size: { content: bfContent, nopickle: bool } -> int  
   
     val create: { splitting: Control.LambdaSplitting.localsetting,  
                   cmData: pid list,  
                   ast: Ast.dec,  
                   source: Source.inputSource,  
                   senv:  senv,  
                   symenv: symenv }  
         -> bfContent  
   
21      type stats = { env: int, inlinfo: int, data: int, code: int }      type stats = { env: int, inlinfo: int, data: int, code: int }
22        type pickle = { pid: pid, pickle: Word8Vector.vector }
23    
24      val read:      val staticPidOf    : bfContents -> pid
25          { name: string, stream: BinIO.instream, modmap: ModuleId.tmap } ->      val exportPidOf    : bfContents -> pid option
26          { content: bfContent, stats: stats }      val lambdaPidOf    : bfContents -> pid
27        val cmDataOf       : bfContents -> pid list
28      val write:  
29          { stream: BinIO.outstream, content: bfContent, nopickle: bool } ->      val senvPickleOf   : bfContents -> pickle
30          stats      val lambdaPickleOf : bfContents -> pickle
31    
32      val exec: bfContent * denv -> denv      (* calculate the size in bytes occupied by some binfile contents *)
33  end (* signature BINFILE *)      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, name: string, stream: BinIO.instream }
45                   -> { contents: bfContents, stats: stats }
46    
47        (* write binfile contents to an IO stream *)
48        val write : { arch: string, stream: BinIO.outstream,
49                      contents: bfContents, nopickle: bool }
50                    -> stats
51    
52        (* Given a dynamic environment, link the code object contained in
53         * some given binfile contents. The result is the delta environment
54         * containing the bindings (if any) resulting from this link operation. *)
55        val exec : bfContents * DynamicEnv.dynenv -> DynamicEnv.dynenv
56    end

Legend:
Removed from v.878  
changed lines
  Added in v.879

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