Fix Trac #3403: interaction of CPR and pattern-match failure
[ghc-hetmet.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]                =  (     _BTM|         _THU|        _SRT         ),
41  [THUNK_1_0]            =  (     _BTM|         _THU|        _SRT         ),
42  [THUNK_0_1]            =  (     _BTM|         _THU|        _SRT         ),
43  [THUNK_2_0]            =  (     _BTM|         _THU|        _SRT         ),
44  [THUNK_1_1]            =  (     _BTM|         _THU|        _SRT         ),
45  [THUNK_0_2]            =  (     _BTM|         _THU|        _SRT         ),
46  [THUNK_STATIC]         =  (     _BTM|    _STA|_THU|        _SRT         ),
47  [THUNK_SELECTOR]       =  (     _BTM|         _THU|        _SRT         ),
48  [BCO]                  =  (_HNF|     _NS                                ),
49  [AP]                   =  (                   _THU                      ),
50  [PAP]                  =  (_HNF|     _NS                                ),
51  [AP_STACK]             =  (                   _THU                      ),
52  [IND]                  =  (          _NS|                        _IND ),
53  [IND_OLDGEN]           =  (          _NS|                        _IND ),
54  [IND_PERM]             =  (          _NS|                        _IND ),
55  [IND_OLDGEN_PERM]      =  (          _NS|                        _IND ),
56  [IND_STATIC]           =  (          _NS|_STA|                   _IND ),
57  [RET_BCO]              =  (     _BTM                                  ),
58  [RET_SMALL]            =  (     _BTM|                       _SRT      ),
59  [RET_BIG]              =  (                                 _SRT      ),
60  [RET_DYN]              =  (                                 _SRT      ),
61  [RET_FUN]              =  ( 0                                         ),
62  [UPDATE_FRAME]         =  (     _BTM                                  ),
63  [CATCH_FRAME]          =  (     _BTM                                  ),
64  [STOP_FRAME]           =  (     _BTM                                  ),
65  [CAF_BLACKHOLE]        =  (     _BTM|_NS|              _UPT           ),
66  [BLACKHOLE]            =  (          _NS|              _UPT           ),
67  [MVAR_CLEAN]           =  (_HNF|     _NS|         _MUT|_UPT           ),
68  [MVAR_DIRTY]           =  (_HNF|     _NS|         _MUT|_UPT           ),
69  [ARR_WORDS]            =  (_HNF|     _NS|              _UPT           ),
70  [MUT_ARR_PTRS_CLEAN]   =  (_HNF|     _NS|         _MUT|_UPT           ),
71  [MUT_ARR_PTRS_DIRTY]   =  (_HNF|     _NS|         _MUT|_UPT           ),
72  [MUT_ARR_PTRS_FROZEN0] =  (_HNF|     _NS|         _MUT|_UPT           ),
73  [MUT_ARR_PTRS_FROZEN]  =  (_HNF|     _NS|              _UPT           ),
74  [MUT_VAR_CLEAN]        =  (_HNF|     _NS|         _MUT|_UPT           ),
75  [MUT_VAR_DIRTY]        =  (_HNF|     _NS|         _MUT|_UPT           ),
76  [WEAK]                 =  (_HNF|     _NS|              _UPT           ),
77  [STABLE_NAME]          =  (_HNF|     _NS|              _UPT           ),
78  [TSO]                  =  (_HNF|     _NS|         _MUT|_UPT           ),
79  [TVAR_WATCH_QUEUE]     =  (          _NS|         _MUT|_UPT           ),
80  [INVARIANT_CHECK_QUEUE]=  (          _NS|         _MUT|_UPT           ),
81  [ATOMIC_INVARIANT]     =  (          _NS|         _MUT|_UPT           ),
82  [TVAR]                 =  (_HNF|     _NS|         _MUT|_UPT           ), 
83  [TREC_CHUNK]           =  (          _NS|         _MUT|_UPT           ),
84  [TREC_HEADER]          =  (          _NS|         _MUT|_UPT           ),
85  [ATOMICALLY_FRAME]     =  (     _BTM                                  ),
86  [CATCH_RETRY_FRAME]    =  (     _BTM                                  ),
87  [CATCH_STM_FRAME]      =  (     _BTM                                  ),
88  [WHITEHOLE]            =  ( 0                                         )
89 };
90
91 #if N_CLOSURE_TYPES != 65
92 #error Closure types changed: update ClosureFlags.c!
93 #endif