SCM Repository
Annotation of /sml/trunk/src/compiler/Execution/codeobj/code-obj.sig
Parent Directory
|
Revision Log
Revision 902 - (view) (download) (as text)
1 : | blume | 902 | (* code-obj.sig |
2 : | * | ||
3 : | * COPYRIGHT (c) 1998 Bell Labs, Lucent Technologies. | ||
4 : | * | ||
5 : | * An interface for manipulating code objects. | ||
6 : | *) | ||
7 : | |||
8 : | signature CODE_OBJ = | ||
9 : | sig | ||
10 : | |||
11 : | type code_object | ||
12 : | |||
13 : | type csegments = { | ||
14 : | c0 : code_object, | ||
15 : | cn : code_object list, | ||
16 : | data : Word8Vector.vector | ||
17 : | } | ||
18 : | |||
19 : | type executable = Unsafe.Object.object -> Unsafe.Object.object | ||
20 : | |||
21 : | exception FormatError | ||
22 : | (* raised by input when there are insufficient bytes *) | ||
23 : | |||
24 : | val alloc : (int * string option) -> code_object | ||
25 : | (* Allocate an unintialized code object of the given number of bytes. | ||
26 : | * The second argument is the optional name of the object. | ||
27 : | *) | ||
28 : | val input : (BinIO.instream * int * string option) -> code_object | ||
29 : | (* Allocate a code object of the given size and initialize it | ||
30 : | * from the input stream. The third argument is the optional | ||
31 : | * name of the object. | ||
32 : | *) | ||
33 : | val output : (BinIO.outstream * code_object) -> unit | ||
34 : | (* Output a code object to the given output stream *) | ||
35 : | |||
36 : | val bytes : code_object -> Word8Array.array | ||
37 : | (* View the code object as an updatable array of bytes. *) | ||
38 : | |||
39 : | val exec : code_object -> executable | ||
40 : | (* View the code object as an executable. This has the side-effect | ||
41 : | * of flushing the instruction cache. | ||
42 : | *) | ||
43 : | |||
44 : | val size : code_object -> int | ||
45 : | (* return the size of the code object *) | ||
46 : | |||
47 : | val mkLiterals : Word8Vector.vector -> Unsafe.Object.object | ||
48 : | (* use the run-time system interpreter to generate a literals | ||
49 : | * vector from a literal bytecode program. | ||
50 : | *) | ||
51 : | |||
52 : | end; | ||
53 : |
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |