1 /* ----------------------------------------------------------------------------
2 * $Id: Closures.h,v 1.2 1998/12/02 13:20:59 simonm Exp $
6 * -------------------------------------------------------------------------- */
12 * The Layout of a closure header depends on which kind of system we're
13 * compiling for: profiling, parallel, ticky, etc.
16 /* -----------------------------------------------------------------------------
18 -------------------------------------------------------------------------- */
26 #else /* !PROFILING */
32 #endif /* PROFILING */
34 /* -----------------------------------------------------------------------------
36 -------------------------------------------------------------------------- */
52 /* -----------------------------------------------------------------------------
53 The ticky-ticky header
55 Comment from old Ticky.h:
57 This is used to record if a closure has been updated but not yet
58 entered. It is set when the closure is updated and cleared when
61 NB: It is {\em not} an ``entry count'', it is an
62 ``entries-after-update count.''
64 The commoning up of @CONST@, @CHARLIKE@ and @INTLIKE@ closures is
65 turned off(?) if this is required. This has only been done for 2s
66 collection. It is done using a nasty hack which defines the
67 @_Evacuate@ and @_Scavenge@ code for @CONST@, @CHARLIKE@ and @INTLIKE@
68 info tables to be @_Evacuate_1@ and @_Scavenge_1_0@.
69 -------------------------------------------------------------------------- */
85 /* -----------------------------------------------------------------------------
86 The full fixed-size closure header
88 The size of the fixed header is the sum of the optional parts plus a single
89 word for the entry code pointer.
90 -------------------------------------------------------------------------- */
93 const struct _StgInfoTable* info;
99 #define FIXED_HS (sizeof(StgHeader))
101 /* -----------------------------------------------------------------------------
104 For any given closure type (defined in InfoTables.h), there is a
105 corresponding structure defined below. The name of the structure
106 is obtained by concatenating the closure type with '_closure'
107 -------------------------------------------------------------------------- */
109 /* All closures follow the generic format */
111 typedef struct StgClosure_ {
113 struct StgClosure_ *payload[0];
118 StgClosure *selectee;
145 StgClosure *indirectee;
150 StgClosure *mut_link;
151 StgClosure *indirectee;
156 StgClosure *indirectee;
157 StgClosure *static_link;
160 typedef struct StgCAF_ {
164 struct StgCAF_ *link;
169 struct StgTSO_ *blocking_queue;
181 StgClosure *payload[0];
189 typedef struct _StgUpdateFrame {
191 struct _StgUpdateFrame *link;
197 struct _StgUpdateFrame *link;
202 struct _StgUpdateFrame *link;
218 } StgIntCharlikeClosure;
220 /* statically allocated */
225 typedef struct _StgForeignObj {
227 StgAddr data; /* pointer to data in non-haskell-land */
230 typedef struct _StgWeak { /* Weak v */
233 StgClosure *value; /* v */
234 StgClosure *finaliser;
235 struct _StgWeak *link;
238 /* Dynamic stack frames - these have a liveness mask in the object
239 * itself, rather than in the info table. Useful for generic heap
250 /* Concurrent communication objects */
254 struct StgTSO_* head;
255 struct StgTSO_* tail;
259 /* Parallel FETCH_ME closures */
263 void *ga; /* type globalAddr is abstract here */
267 #endif /* CLOSURES_H */