Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 430 lines (362 sloc) 12.985 kB
4385968 [project @ 1998-12-02 13:17:09 by simonm]
simonm authored
1 /* ----------------------------------------------------------------------------
7f309f1 [project @ 1999-02-05 16:02:18 by simonm]
simonm authored
2 *
423d477 [project @ 2004-08-13 13:04:50 by simonmar]
simonmar authored
3 * (c) The GHC Team, 1998-2004
4385968 [project @ 1998-12-02 13:17:09 by simonm]
simonm authored
4 *
5 * Closures
6 *
7 * -------------------------------------------------------------------------- */
8
a2a67cd @simonmar RTS tidyup sweep, first phase
simonmar authored
9 #ifndef RTS_STORAGE_CLOSURES_H
10 #define RTS_STORAGE_CLOSURES_H
4385968 [project @ 1998-12-02 13:17:09 by simonm]
simonm authored
11
12 /*
13 * The Layout of a closure header depends on which kind of system we're
14 * compiling for: profiling, parallel, ticky, etc.
15 */
16
17 /* -----------------------------------------------------------------------------
18 The profiling header
19 -------------------------------------------------------------------------- */
20
21 typedef struct {
db61851 [project @ 2001-11-22 14:25:11 by simonmar]
simonmar authored
22 CostCentreStack *ccs;
23 union {
03dc2dd [project @ 2005-03-27 13:41:13 by panne]
panne authored
24 struct _RetainerSet *rs; /* Retainer Set */
25 StgWord ldvw; /* Lag/Drag/Void Word */
db61851 [project @ 2001-11-22 14:25:11 by simonmar]
simonmar authored
26 } hp;
4385968 [project @ 1998-12-02 13:17:09 by simonm]
simonm authored
27 } StgProfHeader;
28
29 /* -----------------------------------------------------------------------------
0f3205e [project @ 2005-04-22 09:32:39 by simonmar]
simonmar authored
30 The SMP header
f6cdf04 @thoughtpolice [ci skip] includes: detabify/dewhitespace rts/storage/Closures.h
thoughtpolice authored
31
beb5737 make the smp way RTS-only, normal libraries now work with -smp
Simon Marlow authored
32 A thunk has a padding word to take the updated value. This is so
33 that the update doesn't overwrite the payload, so we can avoid
34 needing to lock the thunk during entry and update.
f6cdf04 @thoughtpolice [ci skip] includes: detabify/dewhitespace rts/storage/Closures.h
thoughtpolice authored
35
beb5737 make the smp way RTS-only, normal libraries now work with -smp
Simon Marlow authored
36 Note: this doesn't apply to THUNK_STATICs, which have no payload.
37
38 Note: we leave this padding word in all ways, rather than just SMP,
39 so that we don't have to recompile all our libraries for SMP.
0f3205e [project @ 2005-04-22 09:32:39 by simonmar]
simonmar authored
40 -------------------------------------------------------------------------- */
41
42 typedef struct {
43 StgWord pad;
44 } StgSMPThunkHeader;
45
46 /* -----------------------------------------------------------------------------
4385968 [project @ 1998-12-02 13:17:09 by simonm]
simonm authored
47 The full fixed-size closure header
48
49 The size of the fixed header is the sum of the optional parts plus a single
50 word for the entry code pointer.
51 -------------------------------------------------------------------------- */
52
53 typedef struct {
a2a67cd @simonmar RTS tidyup sweep, first phase
simonmar authored
54 const StgInfoTable* info;
612755b [project @ 1999-02-05 12:41:31 by sof]
sof authored
55 #ifdef PROFILING
0f3205e [project @ 2005-04-22 09:32:39 by simonmar]
simonmar authored
56 StgProfHeader prof;
612755b [project @ 1999-02-05 12:41:31 by sof]
sof authored
57 #endif
4385968 [project @ 1998-12-02 13:17:09 by simonm]
simonm authored
58 } StgHeader;
59
0f3205e [project @ 2005-04-22 09:32:39 by simonmar]
simonmar authored
60 typedef struct {
a2a67cd @simonmar RTS tidyup sweep, first phase
simonmar authored
61 const StgInfoTable* info;
0f3205e [project @ 2005-04-22 09:32:39 by simonmar]
simonmar authored
62 #ifdef PROFILING
63 StgProfHeader prof;
64 #endif
65 StgSMPThunkHeader smp;
66 } StgThunkHeader;
67
beb5737 make the smp way RTS-only, normal libraries now work with -smp
Simon Marlow authored
68 #define THUNK_EXTRA_HEADER_W (sizeofW(StgThunkHeader)-sizeofW(StgHeader))
69
4385968 [project @ 1998-12-02 13:17:09 by simonm]
simonm authored
70 /* -----------------------------------------------------------------------------
71 Closure Types
72
73 For any given closure type (defined in InfoTables.h), there is a
74 corresponding structure defined below. The name of the structure
75 is obtained by concatenating the closure type with '_closure'
76 -------------------------------------------------------------------------- */
77
78 /* All closures follow the generic format */
79
a2a67cd @simonmar RTS tidyup sweep, first phase
simonmar authored
80 typedef struct StgClosure_ {
4385968 [project @ 1998-12-02 13:17:09 by simonm]
simonm authored
81 StgHeader header;
aa84d93 [project @ 2001-08-29 17:24:25 by qrczak]
qrczak authored
82 struct StgClosure_ *payload[FLEXIBLE_ARRAY];
22574cf @simonmar fix comment (#7907)
simonmar authored
83 } *StgClosurePtr; // StgClosure defined in rts/Types.h
4385968 [project @ 1998-12-02 13:17:09 by simonm]
simonm authored
84
85 typedef struct {
0f3205e [project @ 2005-04-22 09:32:39 by simonmar]
simonmar authored
86 StgThunkHeader header;
87 struct StgClosure_ *payload[FLEXIBLE_ARRAY];
88 } StgThunk;
89
90 typedef struct {
91 StgThunkHeader header;
4385968 [project @ 1998-12-02 13:17:09 by simonm]
simonm authored
92 StgClosure *selectee;
93 } StgSelector;
94
95 typedef struct {
96 StgHeader header;
f6cdf04 @thoughtpolice [ci skip] includes: detabify/dewhitespace rts/storage/Closures.h
thoughtpolice authored
97 StgHalfWord arity; /* zero if it is an AP */
0bffc41 [project @ 2002-12-11 15:36:20 by simonmar]
simonmar authored
98 StgHalfWord n_args;
f6cdf04 @thoughtpolice [ci skip] includes: detabify/dewhitespace rts/storage/Closures.h
thoughtpolice authored
99 StgClosure *fun; /* really points to a fun */
aa84d93 [project @ 2001-08-29 17:24:25 by qrczak]
qrczak authored
100 StgClosure *payload[FLEXIBLE_ARRAY];
4385968 [project @ 1998-12-02 13:17:09 by simonm]
simonm authored
101 } StgPAP;
102
0f3205e [project @ 2005-04-22 09:32:39 by simonmar]
simonmar authored
103 typedef struct {
104 StgThunkHeader header;
f6cdf04 @thoughtpolice [ci skip] includes: detabify/dewhitespace rts/storage/Closures.h
thoughtpolice authored
105 StgHalfWord arity; /* zero if it is an AP */
0f3205e [project @ 2005-04-22 09:32:39 by simonmar]
simonmar authored
106 StgHalfWord n_args;
f6cdf04 @thoughtpolice [ci skip] includes: detabify/dewhitespace rts/storage/Closures.h
thoughtpolice authored
107 StgClosure *fun; /* really points to a fun */
0f3205e [project @ 2005-04-22 09:32:39 by simonmar]
simonmar authored
108 StgClosure *payload[FLEXIBLE_ARRAY];
109 } StgAP;
0bffc41 [project @ 2002-12-11 15:36:20 by simonmar]
simonmar authored
110
4385968 [project @ 1998-12-02 13:17:09 by simonm]
simonm authored
111 typedef struct {
0f3205e [project @ 2005-04-22 09:32:39 by simonmar]
simonmar authored
112 StgThunkHeader header;
03dc2dd [project @ 2005-03-27 13:41:13 by panne]
panne authored
113 StgWord size; /* number of words in payload */
4385968 [project @ 1998-12-02 13:17:09 by simonm]
simonm authored
114 StgClosure *fun;
03dc2dd [project @ 2005-03-27 13:41:13 by panne]
panne authored
115 StgClosure *payload[FLEXIBLE_ARRAY]; /* contains a chunk of *stack* */
0bffc41 [project @ 2002-12-11 15:36:20 by simonmar]
simonmar authored
116 } StgAP_STACK;
4385968 [project @ 1998-12-02 13:17:09 by simonm]
simonm authored
117
118 typedef struct {
418a70d [project @ 2000-08-15 11:48:06 by simonmar]
simonmar authored
119 StgHeader header;
4385968 [project @ 1998-12-02 13:17:09 by simonm]
simonm authored
120 StgClosure *indirectee;
121 } StgInd;
122
123 typedef struct {
b75f6d0 [project @ 1999-03-09 14:24:43 by sewardj]
sewardj authored
124 StgHeader header;
ee3e75b [project @ 2001-01-29 17:23:40 by simonmar]
simonmar authored
125 StgClosure *indirectee;
126 StgClosure *static_link;
d0bfe30 @simonmar add a const
simonmar authored
127 const StgInfoTable *saved_info;
ee3e75b [project @ 2001-01-29 17:23:40 by simonmar]
simonmar authored
128 } StgIndStatic;
4385968 [project @ 1998-12-02 13:17:09 by simonm]
simonm authored
129
5d52d9b @simonmar New implementation of BLACKHOLEs
simonmar authored
130 typedef struct StgBlockingQueue_ {
131 StgHeader header;
132 struct StgBlockingQueue_ *link; // here so it looks like an IND
133 StgClosure *bh; // the BLACKHOLE
134 StgTSO *owner;
135 struct MessageBlackHole_ *queue;
136 } StgBlockingQueue;
137
ac5ff64 @Tarrasch Comment on StgArrWords vs StgArrBytes
Tarrasch authored
138 /* This struct should be called StgArrBytes rather than StgArrWords.
139 *
140 * One might be very tempted to store the number of words in the bytes field,
141 * but the garbage collector will erase your data then.
142 *
143 * It's name is for historical reasons, see #3800
144 */
4385968 [project @ 1998-12-02 13:17:09 by simonm]
simonm authored
145 typedef struct {
146 StgHeader header;
17c8229 @aslatter FIX #38000 Store StgArrWords payload size in bytes
aslatter authored
147 StgWord bytes;
aa84d93 [project @ 2001-08-29 17:24:25 by qrczak]
qrczak authored
148 StgWord payload[FLEXIBLE_ARRAY];
ac5ff64 @Tarrasch Comment on StgArrWords vs StgArrBytes
Tarrasch authored
149 } StgArrWords; // TODO: s/StgArrWords/StgArrBytes (#8552)
4385968 [project @ 1998-12-02 13:17:09 by simonm]
simonm authored
150
151 typedef struct {
152 StgHeader header;
153 StgWord ptrs;
0417404 @simonmar Fix #650: use a card table to mark dirty sections of mutable arrays
simonmar authored
154 StgWord size; // ptrs plus card table
aa84d93 [project @ 2001-08-29 17:24:25 by qrczak]
qrczak authored
155 StgClosure *payload[FLEXIBLE_ARRAY];
0417404 @simonmar Fix #650: use a card table to mark dirty sections of mutable arrays
simonmar authored
156 // see also: StgMutArrPtrs macros in ClosureMacros.h
4391e44 [project @ 1999-01-13 17:25:37 by simonm]
simonm authored
157 } StgMutArrPtrs;
4385968 [project @ 1998-12-02 13:17:09 by simonm]
simonm authored
158
159 typedef struct {
160 StgHeader header;
90329b6 @tibbe Add SmallArray# and SmallMutableArray# types
tibbe authored
161 StgWord ptrs;
162 StgClosure *payload[FLEXIBLE_ARRAY];
163 } StgSmallMutArrPtrs;
164
165 typedef struct {
166 StgHeader header;
4385968 [project @ 1998-12-02 13:17:09 by simonm]
simonm authored
167 StgClosure *var;
168 } StgMutVar;
169
170 typedef struct _StgUpdateFrame {
171 StgHeader header;
172 StgClosure *updatee;
173 } StgUpdateFrame;
174
175 typedef struct {
176 StgHeader header;
ad3b79d @simonmar New asynchronous exception control API (ghc parts)
simonmar authored
177 StgWord exceptions_blocked;
4385968 [project @ 1998-12-02 13:17:09 by simonm]
simonm authored
178 StgClosure *handler;
179 } StgCatchFrame;
180
181 typedef struct {
f30d527 @simonmar Implement stack chunks and separate TSO/STACK objects
simonmar authored
182 const StgInfoTable* info;
183 struct StgStack_ *next_chunk;
184 } StgUnderflowFrame;
185
186 typedef struct {
4385968 [project @ 1998-12-02 13:17:09 by simonm]
simonm authored
187 StgHeader header;
f6cdf04 @thoughtpolice [ci skip] includes: detabify/dewhitespace rts/storage/Closures.h
thoughtpolice authored
188 } StgStopFrame;
4385968 [project @ 1998-12-02 13:17:09 by simonm]
simonm authored
189
190 typedef struct {
191 StgHeader header;
192 StgWord data;
193 } StgIntCharlikeClosure;
194
195 /* statically allocated */
196 typedef struct {
197 StgHeader header;
198 } StgRetry;
199
ed4cd6d [project @ 1999-01-26 11:12:41 by simonm]
simonm authored
200 typedef struct _StgStableName {
201 StgHeader header;
202 StgWord sn;
203 } StgStableName;
5fec254 [project @ 2000-01-18 12:36:38 by simonmar]
simonmar authored
204
f6cdf04 @thoughtpolice [ci skip] includes: detabify/dewhitespace rts/storage/Closures.h
thoughtpolice authored
205 typedef struct _StgWeak { /* Weak v */
4385968 [project @ 1998-12-02 13:17:09 by simonm]
simonm authored
206 StgHeader header;
d61c623 @takano-akio Allow multiple C finalizers to be attached to a Weak#
takano-akio authored
207 StgClosure *cfinalizers;
4385968 [project @ 1998-12-02 13:17:09 by simonm]
simonm authored
208 StgClosure *key;
f6cdf04 @thoughtpolice [ci skip] includes: detabify/dewhitespace rts/storage/Closures.h
thoughtpolice authored
209 StgClosure *value; /* v */
b41f38a [project @ 1999-02-11 14:22:53 by simonm]
simonm authored
210 StgClosure *finalizer;
4385968 [project @ 1998-12-02 13:17:09 by simonm]
simonm authored
211 struct _StgWeak *link;
212 } StgWeak;
213
d61c623 @takano-akio Allow multiple C finalizers to be attached to a Weak#
takano-akio authored
214 typedef struct _StgCFinalizerList {
10b81c5 [project @ 1999-02-26 17:46:04 by simonm]
simonm authored
215 StgHeader header;
d61c623 @takano-akio Allow multiple C finalizers to be attached to a Weak#
takano-akio authored
216 StgClosure *link;
217 void (*fptr)(void);
218 void *ptr;
219 void *eptr;
220 StgWord flag; /* has environment (0 or 1) */
221 } StgCFinalizerList;
10b81c5 [project @ 1999-02-26 17:46:04 by simonm]
simonm authored
222
0bffc41 [project @ 2002-12-11 15:36:20 by simonmar]
simonmar authored
223 /* Byte code objects. These are fixed size objects with pointers to
224 * four arrays, designed so that a BCO can be easily "re-linked" to
225 * other BCOs, to facilitate GHC's intelligent recompilation. The
226 * array of instructions is static and not re-generated when the BCO
227 * is re-linked, but the other 3 arrays will be regenerated.
228 *
229 * A BCO represents either a function or a stack frame. In each case,
230 * it needs a bitmap to describe to the garbage collector the
231 * pointerhood of its arguments/free variables respectively, and in
b3f5308 [project @ 2003-03-24 14:46:53 by simonmar]
simonmar authored
232 * the case of a function it also needs an arity. These are stored
233 * directly in the BCO, rather than in the instrs array, for two
234 * reasons:
235 * (a) speed: we need to get at the bitmap info quickly when
236 * the GC is examining APs and PAPs that point to this BCO
237 * (b) a subtle interaction with the compacting GC. In compacting
238 * GC, the info that describes the size/layout of a closure
239 * cannot be in an object more than one level of indirection
240 * away from the current object, because of the order in
241 * which pointers are updated to point to their new locations.
0bffc41 [project @ 2002-12-11 15:36:20 by simonmar]
simonmar authored
242 */
243
244 typedef struct {
245 StgHeader header;
f6cdf04 @thoughtpolice [ci skip] includes: detabify/dewhitespace rts/storage/Closures.h
thoughtpolice authored
246 StgArrWords *instrs; /* a pointer to an ArrWords */
247 StgArrWords *literals; /* a pointer to an ArrWords */
248 StgMutArrPtrs *ptrs; /* a pointer to a MutArrPtrs */
03dc2dd [project @ 2005-03-27 13:41:13 by panne]
panne authored
249 StgHalfWord arity; /* arity of this BCO */
250 StgHalfWord size; /* size of this BCO (in words) */
251 StgWord bitmap[FLEXIBLE_ARRAY]; /* an StgLargeBitmap */
0bffc41 [project @ 2002-12-11 15:36:20 by simonmar]
simonmar authored
252 } StgBCO;
253
b3f5308 [project @ 2003-03-24 14:46:53 by simonmar]
simonmar authored
254 #define BCO_BITMAP(bco) ((StgLargeBitmap *)((StgBCO *)(bco))->bitmap)
0bffc41 [project @ 2002-12-11 15:36:20 by simonmar]
simonmar authored
255 #define BCO_BITMAP_SIZE(bco) (BCO_BITMAP(bco)->size)
256 #define BCO_BITMAP_BITS(bco) (BCO_BITMAP(bco)->bitmap)
257 #define BCO_BITMAP_SIZEW(bco) ((BCO_BITMAP_SIZE(bco) + BITS_IN(StgWord) - 1) \
f6cdf04 @thoughtpolice [ci skip] includes: detabify/dewhitespace rts/storage/Closures.h
thoughtpolice authored
258 / BITS_IN(StgWord))
0bffc41 [project @ 2002-12-11 15:36:20 by simonmar]
simonmar authored
259
260 /* A function return stack frame: used when saving the state for a
261 * garbage collection at a function entry point. The function
262 * arguments are on the stack, and we also save the function (its
263 * info table describes the pointerhood of the arguments).
264 *
265 * The stack frame size is also cached in the frame for convenience.
266 */
267 typedef struct {
a2a67cd @simonmar RTS tidyup sweep, first phase
simonmar authored
268 const StgInfoTable* info;
e7c0855 FIX recent PPC crashes introduced by the pointer-tagging patch (I hope)
Simon Marlow authored
269 StgWord size;
0bffc41 [project @ 2002-12-11 15:36:20 by simonmar]
simonmar authored
270 StgClosure * fun;
271 StgClosure * payload[FLEXIBLE_ARRAY];
272 } StgRetFun;
273
4385968 [project @ 1998-12-02 13:17:09 by simonm]
simonm authored
274 /* Concurrent communication objects */
275
f469222 @simonmar Change the representation of the MVar blocked queue
simonmar authored
276 typedef struct StgMVarTSOQueue_ {
277 StgHeader header;
278 struct StgMVarTSOQueue_ *link;
279 struct StgTSO_ *tso;
280 } StgMVarTSOQueue;
281
4385968 [project @ 1998-12-02 13:17:09 by simonm]
simonm authored
282 typedef struct {
f469222 @simonmar Change the representation of the MVar blocked queue
simonmar authored
283 StgHeader header;
284 struct StgMVarTSOQueue_ *head;
285 struct StgMVarTSOQueue_ *tail;
286 StgClosure* value;
4385968 [project @ 1998-12-02 13:17:09 by simonm]
simonm authored
287 } StgMVar;
288
55472d7 [project @ 2005-05-27 14:47:08 by tharris]
tharris authored
289
b61f70c [project @ 2004-11-18 09:56:07 by tharris]
tharris authored
290 /* STM data structures
291 *
292 * StgTVar defines the only type that can be updated through the STM
293 * interface.
f6cdf04 @thoughtpolice [ci skip] includes: detabify/dewhitespace rts/storage/Closures.h
thoughtpolice authored
294 *
b61f70c [project @ 2004-11-18 09:56:07 by tharris]
tharris authored
295 * Note that various optimisations may be possible in order to use less
296 * space for these data structures at the cost of more complexity in the
297 * implementation:
298 *
9cef40b STM invariants
tharris@microsoft.com authored
299 * - In StgTVar, current_value and first_watch_queue_entry could be held in
b61f70c [project @ 2004-11-18 09:56:07 by tharris]
tharris authored
300 * the same field: if any thread is waiting then its expected_value for
f6cdf04 @thoughtpolice [ci skip] includes: detabify/dewhitespace rts/storage/Closures.h
thoughtpolice authored
301 * the tvar is the current value.
b61f70c [project @ 2004-11-18 09:56:07 by tharris]
tharris authored
302 *
303 * - In StgTRecHeader, it might be worthwhile having separate chunks
304 * of read-only and read-write locations. This would save a
305 * new_value field in the read-only locations.
c5cd234 [project @ 2005-11-18 15:24:12 by simonmar]
simonmar authored
306 *
307 * - In StgAtomicallyFrame, we could combine the waiting bit into
308 * the header (maybe a different info tbl for a waiting transaction).
309 * This means we can specialise the code for the atomically frame
310 * (it immediately switches on frame->waiting anyway).
b61f70c [project @ 2004-11-18 09:56:07 by tharris]
tharris authored
311 */
312
9cef40b STM invariants
tharris@microsoft.com authored
313 typedef struct StgTRecHeader_ StgTRecHeader;
314
315 typedef struct StgTVarWatchQueue_ {
b61f70c [project @ 2004-11-18 09:56:07 by tharris]
tharris authored
316 StgHeader header;
9cef40b STM invariants
tharris@microsoft.com authored
317 StgClosure *closure; // StgTSO or StgAtomicInvariant
318 struct StgTVarWatchQueue_ *next_queue_entry;
319 struct StgTVarWatchQueue_ *prev_queue_entry;
320 } StgTVarWatchQueue;
b61f70c [project @ 2004-11-18 09:56:07 by tharris]
tharris authored
321
322 typedef struct {
323 StgHeader header;
55472d7 [project @ 2005-05-27 14:47:08 by tharris]
tharris authored
324 StgClosure *volatile current_value;
9cef40b STM invariants
tharris@microsoft.com authored
325 StgTVarWatchQueue *volatile first_watch_queue_entry;
710d005 [project @ 2005-11-21 20:00:55 by tharris]
tharris authored
326 StgInt volatile num_updates;
b61f70c [project @ 2004-11-18 09:56:07 by tharris]
tharris authored
327 } StgTVar;
328
9cef40b STM invariants
tharris@microsoft.com authored
329 typedef struct {
330 StgHeader header;
331 StgClosure *code;
332 StgTRecHeader *last_execution;
333 StgWord lock;
334 } StgAtomicInvariant;
335
03dc2dd [project @ 2005-03-27 13:41:13 by panne]
panne authored
336 /* new_value == expected_value for read-only accesses */
9cef40b STM invariants
tharris@microsoft.com authored
337 /* new_value is a StgTVarWatchQueue entry when trec in state TREC_WAITING */
b61f70c [project @ 2004-11-18 09:56:07 by tharris]
tharris authored
338 typedef struct {
339 StgTVar *tvar;
340 StgClosure *expected_value;
f6cdf04 @thoughtpolice [ci skip] includes: detabify/dewhitespace rts/storage/Closures.h
thoughtpolice authored
341 StgClosure *new_value;
eba7b66 Merge the smp and threaded RTS ways
Simon Marlow authored
342 #if defined(THREADED_RTS)
710d005 [project @ 2005-11-21 20:00:55 by tharris]
tharris authored
343 StgInt num_updates;
ab3d1f2 [project @ 2005-06-06 08:49:07 by tharris]
tharris authored
344 #endif
b61f70c [project @ 2004-11-18 09:56:07 by tharris]
tharris authored
345 } TRecEntry;
346
710d005 [project @ 2005-11-21 20:00:55 by tharris]
tharris authored
347 #define TREC_CHUNK_NUM_ENTRIES 16
b61f70c [project @ 2004-11-18 09:56:07 by tharris]
tharris authored
348
349 typedef struct StgTRecChunk_ {
350 StgHeader header;
351 struct StgTRecChunk_ *prev_chunk;
352 StgWord next_entry_idx;
353 TRecEntry entries[TREC_CHUNK_NUM_ENTRIES];
354 } StgTRecChunk;
355
f6cdf04 @thoughtpolice [ci skip] includes: detabify/dewhitespace rts/storage/Closures.h
thoughtpolice authored
356 typedef enum {
03dc2dd [project @ 2005-03-27 13:41:13 by panne]
panne authored
357 TREC_ACTIVE, /* Transaction in progress, outcome undecided */
55472d7 [project @ 2005-05-27 14:47:08 by tharris]
tharris authored
358 TREC_CONDEMNED, /* Transaction in progress, inconsistent / out of date reads */
03dc2dd [project @ 2005-03-27 13:41:13 by panne]
panne authored
359 TREC_COMMITTED, /* Transaction has committed, now updating tvars */
360 TREC_ABORTED, /* Transaction has aborted, now reverting tvars */
361 TREC_WAITING, /* Transaction currently waiting */
b61f70c [project @ 2004-11-18 09:56:07 by tharris]
tharris authored
362 } TRecState;
363
9cef40b STM invariants
tharris@microsoft.com authored
364 typedef struct StgInvariantCheckQueue_ {
365 StgHeader header;
366 StgAtomicInvariant *invariant;
367 StgTRecHeader *my_execution;
368 struct StgInvariantCheckQueue_ *next_queue_entry;
369 } StgInvariantCheckQueue;
370
371 struct StgTRecHeader_ {
b61f70c [project @ 2004-11-18 09:56:07 by tharris]
tharris authored
372 StgHeader header;
373 struct StgTRecHeader_ *enclosing_trec;
374 StgTRecChunk *current_chunk;
9cef40b STM invariants
tharris@microsoft.com authored
375 StgInvariantCheckQueue *invariants_to_check;
7408b39 @simonmar Use message-passing to implement throwTo in the RTS
simonmar authored
376 TRecState state;
9cef40b STM invariants
tharris@microsoft.com authored
377 };
b61f70c [project @ 2004-11-18 09:56:07 by tharris]
tharris authored
378
379 typedef struct {
9cef40b STM invariants
tharris@microsoft.com authored
380 StgHeader header;
381 StgClosure *code;
382 StgTVarWatchQueue *next_invariant_to_check;
dce2394 @simonmar propagate the result of atomically properly (fixes #3049)
simonmar authored
383 StgClosure *result;
b61f70c [project @ 2004-11-18 09:56:07 by tharris]
tharris authored
384 } StgAtomicallyFrame;
385
386 typedef struct {
9cef40b STM invariants
tharris@microsoft.com authored
387 StgHeader header;
388 StgClosure *code;
389 StgClosure *handler;
b61f70c [project @ 2004-11-18 09:56:07 by tharris]
tharris authored
390 } StgCatchSTMFrame;
391
392 typedef struct {
9cef40b STM invariants
tharris@microsoft.com authored
393 StgHeader header;
a7c0387 @simonmar Produce new-style Cmm from the Cmm parser
simonmar authored
394 StgWord running_alt_code;
9cef40b STM invariants
tharris@microsoft.com authored
395 StgClosure *first_code;
396 StgClosure *alt_code;
b61f70c [project @ 2004-11-18 09:56:07 by tharris]
tharris authored
397 } StgCatchRetryFrame;
398
7408b39 @simonmar Use message-passing to implement throwTo in the RTS
simonmar authored
399 /* ----------------------------------------------------------------------------
400 Messages
401 ------------------------------------------------------------------------- */
402
403 typedef struct Message_ {
404 StgHeader header;
405 struct Message_ *link;
406 } Message;
407
408 typedef struct MessageWakeup_ {
409 StgHeader header;
410 Message *link;
411 StgTSO *tso;
412 } MessageWakeup;
413
414 typedef struct MessageThrowTo_ {
415 StgHeader header;
5d52d9b @simonmar New implementation of BLACKHOLEs
simonmar authored
416 struct MessageThrowTo_ *link;
7408b39 @simonmar Use message-passing to implement throwTo in the RTS
simonmar authored
417 StgTSO *source;
418 StgTSO *target;
419 StgClosure *exception;
420 } MessageThrowTo;
421
5d52d9b @simonmar New implementation of BLACKHOLEs
simonmar authored
422 typedef struct MessageBlackHole_ {
423 StgHeader header;
424 struct MessageBlackHole_ *link;
425 StgTSO *tso;
426 StgClosure *bh;
427 } MessageBlackHole;
428
a2a67cd @simonmar RTS tidyup sweep, first phase
simonmar authored
429 #endif /* RTS_STORAGE_CLOSURES_H */
Something went wrong with that request. Please try again.