ClosureFlags.c 5.55 KB
Newer Older
1 2 3 4 5 6 7 8
/* -----------------------------------------------------------------------------
 *
 * (c) The GHC Team 1998-1999
 *
 * Closure type flags
 *
 * ---------------------------------------------------------------------------*/

9
#include "PosixSource.h"
10 11 12 13
#include "Rts.h"

StgWord16 closure_flags[] = {

14 15 16 17 18 19 20
/* ToDo: some of these flags seem to be duplicated.
 *       - NS is the same as HNF, and the negation of THU
 * (however, we set NS for indirections, which is probably the
 *  right thing to do, since we never get indirections pointing
 *  to thunks.)
 */

Michael D. Adams's avatar
Michael D. Adams committed
21
/*                              0    1    2    3    4   5   6   7     8 */
22
/*                            HNF  BTM   NS  STA  THU MUT UPT SRT   IND */
23

24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
 [INVALID_OBJECT]       =  ( 0                                           ),
 [CONSTR]               =  (_HNF|     _NS                                ),
 [CONSTR_1_0]           =  (_HNF|     _NS                                ),
 [CONSTR_0_1]           =  (_HNF|     _NS                                ),
 [CONSTR_2_0]           =  (_HNF|     _NS                                ),
 [CONSTR_1_1]           =  (_HNF|     _NS                                ),
 [CONSTR_0_2]           =  (_HNF|     _NS                                ),
 [CONSTR_STATIC]        =  (_HNF|     _NS|_STA                           ),
 [CONSTR_NOCAF_STATIC]  =  (_HNF|     _NS|_STA                           ),
 [FUN]                  =  (_HNF|     _NS|                  _SRT         ),
 [FUN_1_0]              =  (_HNF|     _NS|                  _SRT         ),
 [FUN_0_1]              =  (_HNF|     _NS|                  _SRT         ),
 [FUN_2_0]              =  (_HNF|     _NS|                  _SRT         ),
 [FUN_1_1]              =  (_HNF|     _NS|                  _SRT         ),
 [FUN_0_2]              =  (_HNF|     _NS|                  _SRT         ),
 [FUN_STATIC]           =  (_HNF|     _NS|_STA|             _SRT         ),
40 41 42 43 44 45 46 47
 [THUNK]                =  (                   _THU|        _SRT         ),
 [THUNK_1_0]            =  (                   _THU|        _SRT         ),
 [THUNK_0_1]            =  (                   _THU|        _SRT         ),
 [THUNK_2_0]            =  (                   _THU|        _SRT         ),
 [THUNK_1_1]            =  (                   _THU|        _SRT         ),
 [THUNK_0_2]            =  (                   _THU|        _SRT         ),
 [THUNK_STATIC]         =  (              _STA|_THU|        _SRT         ),
 [THUNK_SELECTOR]       =  (                   _THU|        _SRT         ),
48 49 50 51 52 53
 [BCO]                  =  (_HNF|     _NS                                ),
 [AP]                   =  (                   _THU                      ),
 [PAP]                  =  (_HNF|     _NS                                ),
 [AP_STACK]             =  (                   _THU                      ),
 [IND]                  =  (          _NS|                        _IND ),
 [IND_STATIC]           =  (          _NS|_STA|                   _IND ),
54
 [RET_BCO]              =  ( 0                                         ),
55 56
 [RET_SMALL]            =  (     _BTM|                       _SRT      ),
 [RET_BIG]              =  (                                 _SRT      ),
57
 [RET_FUN]              =  ( 0                                         ),
58 59
 [UPDATE_FRAME]         =  (     _BTM                                  ),
 [CATCH_FRAME]          =  (     _BTM                                  ),
60 61 62
 [UNDERFLOW_FRAME]      =  (     _BTM                                  ),
 [STOP_FRAME]           =  (     _BTM                                  ),
 [BLACKHOLE]            =  (          _NS|              _UPT           ),
63 64 65
 [BLOCKING_QUEUE]       =  (          _NS|         _MUT|_UPT           ),
 [MVAR_CLEAN]           =  (_HNF|     _NS|         _MUT|_UPT           ),
 [MVAR_DIRTY]           =  (_HNF|     _NS|         _MUT|_UPT           ),
66 67
 [TVAR]                 =  (_HNF|     _NS|         _MUT|_UPT           ),
 [ARR_WORDS]            =  (_HNF|     _NS|              _UPT           ),
68 69 70 71 72 73 74 75 76
 [MUT_ARR_PTRS_CLEAN]   =  (_HNF|     _NS|         _MUT|_UPT           ),
 [MUT_ARR_PTRS_DIRTY]   =  (_HNF|     _NS|         _MUT|_UPT           ),
 [MUT_ARR_PTRS_FROZEN0] =  (_HNF|     _NS|         _MUT|_UPT           ),
 [MUT_ARR_PTRS_FROZEN]  =  (_HNF|     _NS|              _UPT           ),
 [MUT_VAR_CLEAN]        =  (_HNF|     _NS|         _MUT|_UPT           ),
 [MUT_VAR_DIRTY]        =  (_HNF|     _NS|         _MUT|_UPT           ),
 [WEAK]                 =  (_HNF|     _NS|              _UPT           ),
 [PRIM]                 =  (_HNF|     _NS|              _UPT           ),
 [MUT_PRIM]             =  (_HNF|     _NS|         _MUT|_UPT           ),
77 78
 [TSO]                  =  (_HNF|     _NS|         _MUT|_UPT           ),
 [STACK]                =  (_HNF|     _NS|         _MUT|_UPT           ),
79 80 81 82
 [TREC_CHUNK]           =  (          _NS|         _MUT|_UPT           ),
 [ATOMICALLY_FRAME]     =  (     _BTM                                  ),
 [CATCH_RETRY_FRAME]    =  (     _BTM                                  ),
 [CATCH_STM_FRAME]      =  (     _BTM                                  ),
83 84 85 86
 [WHITEHOLE]            =  ( 0                                         ),
 [SMALL_MUT_ARR_PTRS_CLEAN]   =  (_HNF|     _NS|         _MUT|_UPT           ),
 [SMALL_MUT_ARR_PTRS_DIRTY]   =  (_HNF|     _NS|         _MUT|_UPT           ),
 [SMALL_MUT_ARR_PTRS_FROZEN0] =  (_HNF|     _NS|         _MUT|_UPT           ),
gcampax's avatar
gcampax committed
87 88
 [SMALL_MUT_ARR_PTRS_FROZEN]  =  (_HNF|     _NS|              _UPT           ),
 [COMPACT_NFDATA]       =  (_HNF|     _NS                              ),
89
};
90

gcampax's avatar
gcampax committed
91
#if N_CLOSURE_TYPES != 65
92 93
#error Closure types changed: update ClosureFlags.c!
#endif