Merge branch 'master' of darcs.haskell.org:/home/darcs/ghc
[ghc.git] / rts / ClosureFlags.c
1 /* -----------------------------------------------------------------------------
2 *
3 * (c) The GHC Team 1998-1999
4 *
5 * Closure type flags
6 *
7 * ---------------------------------------------------------------------------*/
8
9 #include "PosixSource.h"
10 #include "Rts.h"
11
12 StgWord16 closure_flags[] = {
13
14 /* ToDo: some of these flags seem to be duplicated.
15 * - NS is the same as HNF, and the negation of THU
16 * (however, we set NS for indirections, which is probably the
17 * right thing to do, since we never get indirections pointing
18 * to thunks.)
19 */
20
21 /* 0 1 2 3 4 5 6 7 8 */
22 /* HNF BTM NS STA THU MUT UPT SRT IND */
23
24 [INVALID_OBJECT] = ( 0 ),
25 [CONSTR] = (_HNF| _NS ),
26 [CONSTR_1_0] = (_HNF| _NS ),
27 [CONSTR_0_1] = (_HNF| _NS ),
28 [CONSTR_2_0] = (_HNF| _NS ),
29 [CONSTR_1_1] = (_HNF| _NS ),
30 [CONSTR_0_2] = (_HNF| _NS ),
31 [CONSTR_STATIC] = (_HNF| _NS|_STA ),
32 [CONSTR_NOCAF_STATIC] = (_HNF| _NS|_STA ),
33 [FUN] = (_HNF| _NS| _SRT ),
34 [FUN_1_0] = (_HNF| _NS| _SRT ),
35 [FUN_0_1] = (_HNF| _NS| _SRT ),
36 [FUN_2_0] = (_HNF| _NS| _SRT ),
37 [FUN_1_1] = (_HNF| _NS| _SRT ),
38 [FUN_0_2] = (_HNF| _NS| _SRT ),
39 [FUN_STATIC] = (_HNF| _NS|_STA| _SRT ),
40 [THUNK] = ( _THU| _SRT ),
41 [THUNK_1_0] = ( _THU| _SRT ),
42 [THUNK_0_1] = ( _THU| _SRT ),
43 [THUNK_2_0] = ( _THU| _SRT ),
44 [THUNK_1_1] = ( _THU| _SRT ),
45 [THUNK_0_2] = ( _THU| _SRT ),
46 [THUNK_STATIC] = ( _STA|_THU| _SRT ),
47 [THUNK_SELECTOR] = ( _THU| _SRT ),
48 [BCO] = (_HNF| _NS ),
49 [AP] = ( _THU ),
50 [PAP] = (_HNF| _NS ),
51 [AP_STACK] = ( _THU ),
52 [IND] = ( _NS| _IND ),
53 [IND_PERM] = ( _NS| _IND ),
54 [IND_STATIC] = ( _NS|_STA| _IND ),
55 [RET_BCO] = ( 0 ),
56 [RET_SMALL] = ( _BTM| _SRT ),
57 [RET_BIG] = ( _SRT ),
58 [RET_FUN] = ( 0 ),
59 [UPDATE_FRAME] = ( _BTM ),
60 [CATCH_FRAME] = ( _BTM ),
61 [UNDERFLOW_FRAME] = ( _BTM ),
62 [STOP_FRAME] = ( _BTM ),
63 [BLACKHOLE] = ( _NS| _UPT ),
64 [BLOCKING_QUEUE] = ( _NS| _MUT|_UPT ),
65 [MVAR_CLEAN] = (_HNF| _NS| _MUT|_UPT ),
66 [MVAR_DIRTY] = (_HNF| _NS| _MUT|_UPT ),
67 [TVAR] = (_HNF| _NS| _MUT|_UPT ),
68 [ARR_WORDS] = (_HNF| _NS| _UPT ),
69 [MUT_ARR_PTRS_CLEAN] = (_HNF| _NS| _MUT|_UPT ),
70 [MUT_ARR_PTRS_DIRTY] = (_HNF| _NS| _MUT|_UPT ),
71 [MUT_ARR_PTRS_FROZEN0] = (_HNF| _NS| _MUT|_UPT ),
72 [MUT_ARR_PTRS_FROZEN] = (_HNF| _NS| _UPT ),
73 [MUT_VAR_CLEAN] = (_HNF| _NS| _MUT|_UPT ),
74 [MUT_VAR_DIRTY] = (_HNF| _NS| _MUT|_UPT ),
75 [WEAK] = (_HNF| _NS| _UPT ),
76 [PRIM] = (_HNF| _NS| _UPT ),
77 [MUT_PRIM] = (_HNF| _NS| _MUT|_UPT ),
78 [TSO] = (_HNF| _NS| _MUT|_UPT ),
79 [STACK] = (_HNF| _NS| _MUT|_UPT ),
80 [TREC_CHUNK] = ( _NS| _MUT|_UPT ),
81 [ATOMICALLY_FRAME] = ( _BTM ),
82 [CATCH_RETRY_FRAME] = ( _BTM ),
83 [CATCH_STM_FRAME] = ( _BTM ),
84 [WHITEHOLE] = ( 0 )
85 };
86
87 #if N_CLOSURE_TYPES != 61
88 #error Closure types changed: update ClosureFlags.c!
89 #endif