Permalink
Browse files

[project @ 2001-01-29 17:23:40 by simonmar]

Remove the old Hugs CAF code, install our own (minimal, somewhat
cryptic, but better commented) CAF reversion story.  See
Storage.c:newCaf() for the details.
  • Loading branch information...
1 parent 489aed0 commit ee3e75b51e5a86dda79bb990a83bfaa49915a22a simonmar committed Jan 29, 2001
@@ -1,5 +1,5 @@
/* ----------------------------------------------------------------------------
- * $Id: ClosureTypes.h,v 1.13 2000/04/05 14:26:31 panne Exp $
+ * $Id: ClosureTypes.h,v 1.14 2001/01/29 17:23:41 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
@@ -47,19 +47,17 @@
#define IND_PERM 31
#define IND_OLDGEN_PERM 32
#define IND_STATIC 33
-#define CAF_UNENTERED 34
-#define CAF_ENTERED 35
-#define CAF_BLACKHOLE 36
-#define RET_BCO 37
-#define RET_SMALL 38
-#define RET_VEC_SMALL 39
-#define RET_BIG 40
-#define RET_VEC_BIG 41
-#define RET_DYN 42
-#define UPDATE_FRAME 43
-#define CATCH_FRAME 44
-#define STOP_FRAME 45
-#define SEQ_FRAME 46
+#define RET_BCO 36
+#define RET_SMALL 37
+#define RET_VEC_SMALL 38
+#define RET_BIG 39
+#define RET_VEC_BIG 40
+#define RET_DYN 41
+#define UPDATE_FRAME 42
+#define CATCH_FRAME 43
+#define STOP_FRAME 44
+#define SEQ_FRAME 45
+#define CAF_BLACKHOLE 46
#define BLACKHOLE 47
#define BLACKHOLE_BQ 48
#define SE_BLACKHOLE 49
View
@@ -1,5 +1,5 @@
/* ----------------------------------------------------------------------------
- * $Id: Closures.h,v 1.24 2000/12/19 16:48:58 sewardj Exp $
+ * $Id: Closures.h,v 1.25 2001/01/29 17:23:41 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
@@ -186,18 +186,13 @@ typedef struct {
} StgIndOldGen;
typedef struct {
- StgHeader header;
- StgClosure *indirectee;
- StgClosure *static_link;
-} StgIndStatic;
-
-typedef struct StgCAF_ {
StgHeader header;
- StgClosure *body;
- StgMutClosure *mut_link;
- StgClosure *value;
- struct StgCAF_ *link;
-} StgCAF;
+ StgClosure *indirectee;
+ StgClosure *static_link;
+#ifdef GHCI
+ struct _StgInfoTable *saved_info;
+#endif
+} StgIndStatic;
typedef struct {
StgHeader header;
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------------
- * $Id: StgMiscClosures.h,v 1.32 2001/01/15 16:55:25 sewardj Exp $
+ * $Id: StgMiscClosures.h,v 1.33 2001/01/29 17:23:41 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
@@ -21,8 +21,8 @@ STGFUN(stg_IND_OLDGEN_entry);
STGFUN(stg_IND_OLDGEN_PERM_entry);
STGFUN(stg_CAF_UNENTERED_entry);
STGFUN(stg_CAF_ENTERED_entry);
-STGFUN(stg_CAF_BLACKHOLE_entry);
STGFUN(stg_BLACKHOLE_entry);
+STGFUN(stg_CAF_BLACKHOLE_entry);
STGFUN(stg_BLACKHOLE_BQ_entry);
#ifdef SMP
STGFUN(stg_WHITEHOLE_entry);
@@ -97,8 +97,8 @@ extern DLL_IMPORT_RTS const StgInfoTable stg_IND_OLDGEN_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_IND_OLDGEN_PERM_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_CAF_UNENTERED_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_CAF_ENTERED_info;
-extern DLL_IMPORT_RTS const StgInfoTable stg_CAF_BLACKHOLE_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_BLACKHOLE_info;
+extern DLL_IMPORT_RTS const StgInfoTable stg_CAF_BLACKHOLE_info;
extern DLL_IMPORT_RTS const StgInfoTable stg_BLACKHOLE_BQ_info;
#ifdef SMP
extern DLL_IMPORT_RTS const StgInfoTable stg_WHITEHOLE_info;
View
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------------
- * $Id: Updates.h,v 1.21 2000/12/04 12:31:20 simonmar Exp $
+ * $Id: Updates.h,v 1.22 2001/01/29 17:23:41 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
@@ -61,6 +61,16 @@
}
#endif
+#define UPD_STATIC_IND(updclosure, heapptr) \
+ { \
+ const StgInfoTable *info; \
+ info = ((StgClosure *)updclosure)->header.info; \
+ AWAKEN_STATIC_BQ(info,updclosure); \
+ updateWithStaticIndirection(info, \
+ (StgClosure *)updclosure, \
+ (StgClosure *)heapptr); \
+ }
+
#if defined(PROFILING) || defined(TICKY_TICKY)
#define UPD_PERM_IND(updclosure, heapptr) \
{ \
@@ -160,6 +170,11 @@ extern void awakenBlockedQueue(StgTSO *q);
DO_AWAKEN_BQ(closure); \
}
+#define AWAKEN_STATIC_BQ(info,closure) \
+ if (info == &stg_BLACKHOLE_BQ_STATIC_info) { \
+ DO_AWAKEN_BQ(closure); \
+ }
+
#endif /* GRAN || PAR */
/* -------------------------------------------------------------------------
View
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------------
- * $Id: ClosureFlags.c,v 1.6 2000/01/13 14:34:02 hwloidl Exp $
+ * $Id: ClosureFlags.c,v 1.7 2001/01/29 17:23:40 simonmar Exp $
*
* (c) The GHC Team 1998-1999
*
@@ -26,73 +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_UNENTERED */ ( 0 ),
-/* CAF_ENTERED */ ( 0 ),
-/* 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 ),
+[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 ),
-/* 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 )
+[N_CLOSURE_TYPES ] = ( 0 )
};
Oops, something went wrong.

0 comments on commit ee3e75b

Please sign in to comment.