hadrian: eliminate most of the remaining big rule enumerations
[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 4 5 6 7 8 */
22 /* HNF BTM NS 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_NOCAF] = (_HNF| _NS ),
32 [FUN] = (_HNF| _NS| _SRT ),
33 [FUN_1_0] = (_HNF| _NS| _SRT ),
34 [FUN_0_1] = (_HNF| _NS| _SRT ),
35 [FUN_2_0] = (_HNF| _NS| _SRT ),
36 [FUN_1_1] = (_HNF| _NS| _SRT ),
37 [FUN_0_2] = (_HNF| _NS| _SRT ),
38 [FUN_STATIC] = (_HNF| _NS| _SRT ),
39 [THUNK] = ( _THU| _SRT ),
40 [THUNK_1_0] = ( _THU| _SRT ),
41 [THUNK_0_1] = ( _THU| _SRT ),
42 [THUNK_2_0] = ( _THU| _SRT ),
43 [THUNK_1_1] = ( _THU| _SRT ),
44 [THUNK_0_2] = ( _THU| _SRT ),
45 [THUNK_STATIC] = ( _THU| _SRT ),
46 [THUNK_SELECTOR] = ( _THU| _SRT ),
47 [BCO] = (_HNF| _NS ),
48 [AP] = ( _THU ),
49 [PAP] = (_HNF| _NS ),
50 [AP_STACK] = ( _THU ),
51 [IND] = ( _NS| _IND ),
52 [IND_STATIC] = ( _NS| _IND ),
53 [RET_BCO] = ( 0 ),
54 [RET_SMALL] = ( _BTM| _SRT ),
55 [RET_BIG] = ( _SRT ),
56 [RET_FUN] = ( 0 ),
57 [UPDATE_FRAME] = ( _BTM ),
58 [CATCH_FRAME] = ( _BTM ),
59 [UNDERFLOW_FRAME] = ( _BTM ),
60 [STOP_FRAME] = ( _BTM ),
61 [BLACKHOLE] = ( _NS| _UPT ),
62 [BLOCKING_QUEUE] = ( _NS| _MUT|_UPT ),
63 [MVAR_CLEAN] = (_HNF| _NS| _MUT|_UPT ),
64 [MVAR_DIRTY] = (_HNF| _NS| _MUT|_UPT ),
65 [TVAR] = (_HNF| _NS| _MUT|_UPT ),
66 [ARR_WORDS] = (_HNF| _NS| _UPT ),
67 [MUT_ARR_PTRS_CLEAN] = (_HNF| _NS| _MUT|_UPT ),
68 [MUT_ARR_PTRS_DIRTY] = (_HNF| _NS| _MUT|_UPT ),
69 [MUT_ARR_PTRS_FROZEN_DIRTY] = (_HNF| _NS| _MUT|_UPT ),
70 [MUT_ARR_PTRS_FROZEN_CLEAN] = (_HNF| _NS| _UPT ),
71 [MUT_VAR_CLEAN] = (_HNF| _NS| _MUT|_UPT ),
72 [MUT_VAR_DIRTY] = (_HNF| _NS| _MUT|_UPT ),
73 [WEAK] = (_HNF| _NS| _UPT ),
74 [PRIM] = (_HNF| _NS| _UPT ),
75 [MUT_PRIM] = (_HNF| _NS| _MUT|_UPT ),
76 [TSO] = (_HNF| _NS| _MUT|_UPT ),
77 [STACK] = (_HNF| _NS| _MUT|_UPT ),
78 [TREC_CHUNK] = ( _NS| _MUT|_UPT ),
79 [ATOMICALLY_FRAME] = ( _BTM ),
80 [CATCH_RETRY_FRAME] = ( _BTM ),
81 [CATCH_STM_FRAME] = ( _BTM ),
82 [WHITEHOLE] = ( 0 ),
83 [SMALL_MUT_ARR_PTRS_CLEAN] = (_HNF| _NS| _MUT|_UPT ),
84 [SMALL_MUT_ARR_PTRS_DIRTY] = (_HNF| _NS| _MUT|_UPT ),
85 [SMALL_MUT_ARR_PTRS_FROZEN_DIRTY] = (_HNF| _NS| _MUT|_UPT ),
86 [SMALL_MUT_ARR_PTRS_FROZEN_CLEAN] = (_HNF| _NS| _UPT ),
87 [COMPACT_NFDATA] = (_HNF| _NS ),
88 };
89
90 #if N_CLOSURE_TYPES != 64
91 #error Closure types changed: update ClosureFlags.c!
92 #endif