1 (* Copyright (C) 2014,2017 Matthew Fluet.
2 * Copyright (C) 2004-2007 Henry Cejtin, Matthew Fluet, Suresh
3 * Jagannathan, and Stephen Weeks.
5 * MLton is released under a BSD-style license.
6 * See the file MLton-LICENSE for details.
9 signature REP_TYPE_STRUCTS =
11 structure CFunction: C_FUNCTION
12 structure CType: C_TYPE
13 structure Label: LABEL
14 structure ObjptrTycon: OBJPTR_TYCON
16 structure RealSize: REAL_SIZE
17 structure Runtime: RUNTIME
18 structure Scale: SCALE
19 structure WordSize: WORD_SIZE
20 structure WordX: WORD_X
21 structure WordXVector: WORD_X_VECTOR
22 sharing CFunction = Prim.CFunction
23 sharing RealSize = Prim.RealSize
24 sharing WordSize = Prim.WordSize = WordX.WordSize
25 sharing WordX = WordXVector.WordX
30 include REP_TYPE_STRUCTS
32 structure ObjectType: OBJECT_TYPE
34 sharing type t = ObjectType.ty
36 val bogusWord: t -> WordX.t
37 val align: t * Bytes.t -> Bytes.t
38 val arrayOffsetIsOk: {base: t,
41 tyconTy: ObjptrTycon.t -> ObjectType.t,
43 scale: Scale.t} -> bool
46 val bytes: t -> Bytes.t
47 val castIsOk: {from: t,
49 tyconTy: ObjptrTycon.t -> ObjectType.t} -> bool
50 val checkPrimApp: {args: t vector,
52 result: t option} -> bool
53 val cpointer: unit -> t
57 val deLabel: t -> Label.t option
58 val deObjptr: t -> ObjptrTycon.t option
59 val deReal: t -> RealSize.t option
60 val deSeq: t -> t vector option
61 val deWord: t -> WordSize.t option
62 val equals: t * t -> bool
63 val exnStack: unit -> t
64 val gcState: unit -> t
65 val exists: t * (t -> bool) -> bool
67 val isCPointer: t -> bool
68 val isObjptr: t -> bool
70 val isSubtype: t * t -> bool
71 val label: Label.t -> t
72 val layout: t -> Layout.t
73 val name: t -> string (* simple one letter abbreviation *)
74 val ofGCField: Runtime.GCField.t -> t
75 val ofWordXVector: WordXVector.t -> t
76 val ofWordX: WordX.t -> t
77 val offsetIsOk: {base: t,
79 tyconTy: ObjptrTycon.t -> ObjectType.t,
81 val objptr: ObjptrTycon.t -> t
82 val objptrHeader: unit -> t
83 val real: RealSize.t -> t
84 val resize: t * Bits.t -> t
85 val seq: t vector -> t
86 val seqIndex: unit -> t
89 val sum: t vector -> t
91 val toCType: t -> CType.t
93 val width: t -> Bits.t
94 val word: WordSize.t -> t
95 val wordVector: WordSize.t -> t
98 structure BuiltInCFunction:
100 val bug: unit -> t CFunction.t
101 val gc: {maySwitchThreads: bool} -> t CFunction.t