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/branches/primop-branch/src/compiler/Execution/main/execute.sml
ViewVC logotype

Diff of /sml/branches/primop-branch/src/compiler/Execution/main/execute.sml

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

revision 1470, Mon Mar 29 22:45:55 2004 UTC revision 1471, Mon Mar 29 22:45:55 2004 UTC
# Line 8  Line 8 
8   *****************************************************************************)   *****************************************************************************)
9    
10  structure Execute : sig  structure Execute : sig
11      val mkexec : CodeObj.csegments -> CodeObj.executable  
12        exception Link                      (* For compilation manager to
13                                             * signal to interactive loop that
14                                             * error messages have been issued
15                                             * already.  The interactive loop
16                                             * should simply discard this
17                                             * exception (keep quiet) and
18                                             * go to the next input prompt. *)
19    
20        val mkexec : { cs : CodeObj.csegments,
21                       exnwrapper : exn -> exn } -> CodeObj.executable
22      val execute : { executable: CodeObj.executable,      val execute : { executable: CodeObj.executable,
23                      imports: ImportTree.import list,                      imports: ImportTree.import list,
24                      exportPid: PersStamps.persstamp option,                      exportPid: PersStamps.persstamp option,
25                      dynenv: DynamicEnv.env } -> DynamicEnv.env                      dynenv: DynamicEnv.env } -> DynamicEnv.env
26  end = struct  end = struct
27    
28        exception Link
29    
30      structure Obj = Unsafe.Object      structure Obj = Unsafe.Object
31      type object = Obj.object      type object = Obj.object
32    
# Line 22  Line 35 
35    
36    
37      (** turn the byte-vector-like code segments into an executable closure *)      (** turn the byte-vector-like code segments into an executable closure *)
38      fun mkexec (cs : CodeObj.csegments) = let      fun mkexec { cs : CodeObj.csegments, exnwrapper } = let
39          val ex = CodeObj.exec (#c0 cs)          val ex = CodeObj.exec (#c0 cs)
40          val nex =          val nex =
41              if (Word8Vector.length (#data cs) > 0) then              if (Word8Vector.length (#data cs) > 0) then
# Line 30  Line 43 
43                      ex (Obj.mkTuple (Obj.toTuple ivec @                      ex (Obj.mkTuple (Obj.toTuple ivec @
44                                       [CodeObj.mkLiterals (#data cs)])))                                       [CodeObj.mkLiterals (#data cs)])))
45              else (fn ivec => ex ivec)              else (fn ivec => ex ivec)
46      in          val executable =
47          foldl (fn (c, r) => (CodeObj.exec c) o r) nex (#cn cs)          foldl (fn (c, r) => (CodeObj.exec c) o r) nex (#cn cs)
48        in
49            fn args => (executable args handle e => raise exnwrapper e)
50      end      end
51    
52      (** perform the execution of the excutable, output the new dynenv *)      (** perform the execution of the excutable, output the new dynenv *)

Legend:
Removed from v.1470  
changed lines
  Added in v.1471

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