Commit b126c85f authored by simonmar's avatar simonmar

[project @ 2001-03-02 16:12:18 by simonmar]

Add a new closure flag, IND, to identify indirections.
parent ffaa2614
/* ----------------------------------------------------------------------------
* $Id: InfoTables.h,v 1.19 2000/04/05 15:27:59 simonmar Exp $
* $Id: InfoTables.h,v 1.20 2001/03/02 16:12:18 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
......@@ -117,14 +117,15 @@ typedef struct {
/* The type flags provide quick access to certain properties of a closure. */
#define _HNF (1<<0) /* head normal form? */
#define _HNF (1<<0) /* head normal form? */
#define _BTM (1<<1) /* bitmap-style layout? */
#define _NS (1<<2) /* non-sparkable */
#define _STA (1<<3) /* static? */
#define _THU (1<<4) /* thunk? */
#define _MUT (1<<5) /* mutable? */
#define _UPT (1<<6) /* unpointed? */
#define _SRT (1<<7) /* has an SRT? */
#define _NS (1<<2) /* non-sparkable */
#define _STA (1<<3) /* static? */
#define _THU (1<<4) /* thunk? */
#define _MUT (1<<5) /* mutable? */
#define _UPT (1<<6) /* unpointed? */
#define _SRT (1<<7) /* has an SRT? */
#define _IND (1<<8) /* is an indirection? */
#define isSTATIC(flags) ((flags) &_STA)
#define isMUTABLE(flags) ((flags) &_MUT)
......@@ -139,13 +140,13 @@ extern StgWord16 closure_flags[];
#define closure_HNF(c) ( closureFlags(c) & _HNF)
#define closure_BITMAP(c) ( closureFlags(c) & _BTM)
#define closure_NON_SPARK(c) ( (closureFlags(c) & _NS))
#define closure_SHOULD_SPARK(c) (!(closureFlags(c) & _NS))
#define closure_STATIC(c) ( closureFlags(c) & _STA)
#define closure_THUNK(c) ( closureFlags(c) & _THU)
#define closure_MUTABLE(c) ( closureFlags(c) & _MUT)
#define closure_UNPOINTED(c) ( closureFlags(c) & _UPT)
#define closure_SRT(c) ( closureFlags(c) & _SRT)
#define closure_IND(c) ( closureFlags(c) & _IND)
/* same as above but for info-ptr rather than closure */
#define ipFlags(ip) (closure_flags[ip->type])
......@@ -158,6 +159,7 @@ extern StgWord16 closure_flags[];
#define ip_MUTABLE(ip) ( ipFlags(ip) & _MUT)
#define ip_UNPOINTED(ip) ( ipFlags(ip) & _UPT)
#define ip_SRT(ip) ( ipFlags(ip) & _SRT)
#define ip_IND(ip) ( ipFlags(ip) & _IND)
/* -----------------------------------------------------------------------------
Info Tables
......
/* -----------------------------------------------------------------------------
* $Id: ClosureFlags.c,v 1.7 2001/01/29 17:23:40 simonmar Exp $
* $Id: ClosureFlags.c,v 1.8 2001/03/02 16:12:18 simonmar Exp $
*
* (c) The GHC Team 1998-1999
*
......@@ -26,69 +26,69 @@ StgWord16 closure_flags[] = {
/* 0 1 2 3 4 5 6 7 */
/* HNF BTM NS STA THU MUT UPT SRT */
[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_INTLIKE ] = (_HNF| _NS|_STA ),
[CONSTR_CHARLIKE ] = (_HNF| _NS|_STA ),
[CONSTR_STATIC ] = (_HNF| _NS|_STA ),
[CONSTR_NOCAF_STATIC ] = (_HNF| _NS|_STA ),
[FUN ] = (_HNF| _NS| _SRT ),
[FUN_1_0 ] = (_HNF| _NS ),
[FUN_0_1 ] = (_HNF| _NS ),
[FUN_2_0 ] = (_HNF| _NS ),
[FUN_1_1 ] = (_HNF| _NS ),
[FUN_0_2 ] = (_HNF| _NS ),
[FUN_STATIC ] = (_HNF| _NS|_STA| _SRT ),
[THUNK ] = ( _BTM| _THU| _SRT ),
[THUNK_1_0 ] = ( _BTM| _THU| _SRT ),
[THUNK_0_1 ] = ( _BTM| _THU| _SRT ),
[THUNK_2_0 ] = ( _BTM| _THU| _SRT ),
[THUNK_1_1 ] = ( _BTM| _THU| _SRT ),
[THUNK_0_2 ] = ( _BTM| _THU| _SRT ),
[THUNK_STATIC ] = ( _BTM| _STA|_THU| _SRT ),
[THUNK_SELECTOR ] = ( _BTM| _THU| _SRT ),
[BCO ] = (_HNF| _NS ),
[AP_UPD ] = ( _BTM| _THU ),
[PAP ] = (_HNF| _NS ),
[IND ] = ( _NS ),
[IND_OLDGEN ] = ( _NS ),
[IND_PERM ] = ( _NS ),
[IND_OLDGEN_PERM ] = ( _NS ),
[IND_STATIC ] = ( _NS|_STA ),
[CAF_BLACKHOLE ] = ( _BTM|_NS| _MUT|_UPT ),
[RET_BCO ] = ( _BTM ),
[RET_SMALL ] = ( _BTM| _SRT),
[RET_VEC_SMALL ] = ( _BTM| _SRT),
[RET_BIG ] = ( _SRT),
[RET_VEC_BIG ] = ( _SRT),
[RET_DYN ] = ( _SRT),
[UPDATE_FRAME ] = ( _BTM ),
[CATCH_FRAME ] = ( _BTM ),
[STOP_FRAME ] = ( _BTM ),
[SEQ_FRAME ] = ( _BTM ),
[BLACKHOLE ] = ( _NS| _MUT|_UPT ),
[BLACKHOLE_BQ ] = ( _NS| _MUT|_UPT ),
[SE_BLACKHOLE ] = ( _NS| _UPT ),
[SE_CAF_BLACKHOLE ] = ( _NS| _UPT ),
[MVAR ] = (_HNF| _NS| _MUT|_UPT ),
[ARR_WORDS ] = (_HNF| _NS| _UPT ),
[MUT_ARR_PTRS ] = (_HNF| _NS| _MUT|_UPT ),
[MUT_ARR_PTRS_FROZEN ] = (_HNF| _NS| _MUT|_UPT ),
[MUT_VAR ] = (_HNF| _NS| _MUT|_UPT ),
[WEAK ] = (_HNF| _NS| _UPT ),
[FOREIGN ] = (_HNF| _NS| _UPT ),
[STABLE_NAME ] = (_HNF| _NS| _UPT ),
[TSO ] = (_HNF| _NS| _MUT|_UPT ),
[BLOCKED_FETCH ] = (_HNF| _NS| _MUT|_UPT ),
[FETCH_ME ] = (_HNF| _NS| _MUT|_UPT ),
[FETCH_ME_BQ ] = ( _NS| _MUT|_UPT ),
[RBH ] = ( _NS| _MUT|_UPT ),
[EVACUATED ] = ( 0 ),
[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_INTLIKE ] = (_HNF| _NS|_STA ),
[CONSTR_CHARLIKE ] = (_HNF| _NS|_STA ),
[CONSTR_STATIC ] = (_HNF| _NS|_STA ),
[CONSTR_NOCAF_STATIC ] = (_HNF| _NS|_STA ),
[FUN ] = (_HNF| _NS| _SRT ),
[FUN_1_0 ] = (_HNF| _NS ),
[FUN_0_1 ] = (_HNF| _NS ),
[FUN_2_0 ] = (_HNF| _NS ),
[FUN_1_1 ] = (_HNF| _NS ),
[FUN_0_2 ] = (_HNF| _NS ),
[FUN_STATIC ] = (_HNF| _NS|_STA| _SRT ),
[THUNK ] = ( _BTM| _THU| _SRT ),
[THUNK_1_0 ] = ( _BTM| _THU| _SRT ),
[THUNK_0_1 ] = ( _BTM| _THU| _SRT ),
[THUNK_2_0 ] = ( _BTM| _THU| _SRT ),
[THUNK_1_1 ] = ( _BTM| _THU| _SRT ),
[THUNK_0_2 ] = ( _BTM| _THU| _SRT ),
[THUNK_STATIC ] = ( _BTM| _STA|_THU| _SRT ),
[THUNK_SELECTOR ] = ( _BTM| _THU| _SRT ),
[BCO ] = (_HNF| _NS ),
[AP_UPD ] = ( _BTM| _THU ),
[PAP ] = (_HNF| _NS ),
[IND ] = ( _NS |_IND ),
[IND_OLDGEN ] = ( _NS |_IND ),
[IND_PERM ] = ( _NS |_IND ),
[IND_OLDGEN_PERM ] = ( _NS |_IND ),
[IND_STATIC ] = ( _NS|_STA |_IND ),
[CAF_BLACKHOLE ] = ( _BTM|_NS| _MUT|_UPT ),
[RET_BCO ] = ( _BTM ),
[RET_SMALL ] = ( _BTM| _SRT ),
[RET_VEC_SMALL ] = ( _BTM| _SRT ),
[RET_BIG ] = ( _SRT ),
[RET_VEC_BIG ] = ( _SRT ),
[RET_DYN ] = ( _SRT ),
[UPDATE_FRAME ] = ( _BTM ),
[CATCH_FRAME ] = ( _BTM ),
[STOP_FRAME ] = ( _BTM ),
[SEQ_FRAME ] = ( _BTM ),
[BLACKHOLE ] = ( _NS| _MUT|_UPT ),
[BLACKHOLE_BQ ] = ( _NS| _MUT|_UPT ),
[SE_BLACKHOLE ] = ( _NS| _UPT ),
[SE_CAF_BLACKHOLE ] = ( _NS| _UPT ),
[MVAR ] = (_HNF| _NS| _MUT|_UPT ),
[ARR_WORDS ] = (_HNF| _NS| _UPT ),
[MUT_ARR_PTRS ] = (_HNF| _NS| _MUT|_UPT ),
[MUT_ARR_PTRS_FROZEN ] = (_HNF| _NS| _MUT|_UPT ),
[MUT_VAR ] = (_HNF| _NS| _MUT|_UPT ),
[WEAK ] = (_HNF| _NS| _UPT ),
[FOREIGN ] = (_HNF| _NS| _UPT ),
[STABLE_NAME ] = (_HNF| _NS| _UPT ),
[TSO ] = (_HNF| _NS| _MUT|_UPT ),
[BLOCKED_FETCH ] = (_HNF| _NS| _MUT|_UPT ),
[FETCH_ME ] = (_HNF| _NS| _MUT|_UPT ),
[FETCH_ME_BQ ] = ( _NS| _MUT|_UPT ),
[RBH ] = ( _NS| _MUT|_UPT ),
[EVACUATED ] = ( 0 ),
[N_CLOSURE_TYPES ] = ( 0 )
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment