* impedence matching:
*/
#ifdef CMINUSMINUS
+#define BLOCK_BEGIN
+#define BLOCK_END
#define DECLARE_IPTR(info) W_ info
#define FCALL foreign "C"
#define INFO_PTR(info) info
#define ARG_PTR "ptr"
#else
+#define BLOCK_BEGIN {
+#define BLOCK_END }
#define DECLARE_IPTR(info) const StgInfoTable *(info)
#define FCALL /* nothing */
#define INFO_PTR(info) &info
/* UPD_IND actually does a PERM_IND if TICKY_TICKY is on;
if you *really* need an IND use UPD_REAL_IND
*/
-#define UPD_REAL_IND(updclosure, ind_info, heapptr, and_then) \
- DECLARE_IPTR(info); \
- info = GET_INFO(updclosure); \
- AWAKEN_BQ(info,updclosure); \
- updateWithIndirection(GET_INFO(updclosure), ind_info, \
- updclosure, \
- heapptr, \
- and_then);
+#define UPD_REAL_IND(updclosure, ind_info, heapptr, and_then) \
+ BLOCK_BEGIN \
+ DECLARE_IPTR(info); \
+ info = GET_INFO(updclosure); \
+ AWAKEN_BQ(info,updclosure); \
+ updateWithIndirection(GET_INFO(updclosure), ind_info, \
+ updclosure, \
+ heapptr, \
+ and_then); \
+ BLOCK_END
#if defined(PROFILING) || defined(TICKY_TICKY)
#define UPD_PERM_IND(updclosure, heapptr) \
+ BLOCK_BEGIN \
DECLARE_IPTR(info); \
info = GET_INFO(updclosure); \
AWAKEN_BQ(info,updclosure); \
updateWithPermIndirection(info, \
updclosure, \
- heapptr);
+ heapptr); \
+ BLOCK_END
#endif
#if defined(RTS_SUPPORTS_THREADS)
# ifdef TICKY_TICKY
# define UPD_IND_NOLOCK(updclosure, heapptr) \
+ BLOCK_BEGIN \
DECLARE_IPTR(info); \
info = GET_INFO(updclosure); \
AWAKEN_BQ_NOLOCK(info,updclosure); \
updateWithPermIndirection(info, \
updclosure, \
- heapptr)
+ heapptr); \
+ BLOCK_END
# else
-# define UPD_IND_NOLOCK(updclosure, heapptr) \
- DECLARE_IPTR(info); \
- info = GET_INFO(updclosure); \
- AWAKEN_BQ_NOLOCK(info,updclosure); \
- updateWithIndirection(info, INFO_PTR(stg_IND_info), \
- updclosure, \
- heapptr,);
+# define UPD_IND_NOLOCK(updclosure, heapptr) \
+ BLOCK_BEGIN \
+ DECLARE_IPTR(info); \
+ info = GET_INFO(updclosure); \
+ AWAKEN_BQ_NOLOCK(info,updclosure); \
+ updateWithIndirection(info, INFO_PTR(stg_IND_info), \
+ updclosure, \
+ heapptr,); \
+ BLOCK_END
# endif
#else
LDV_RECORD_DEAD_FILL_SLOP_DYNAMIC(p1); \
bd = Bdescr((P_)p1); \
if (bd->gen_no == 0) { \
+ ((StgInd *)p1)->indirectee = p2; \
SET_INFO(p1, ind_info); \
LDV_RECORD_CREATE(p1); \
TICK_UPD_NEW_IND(); \
and_then; \
- }}
+ } else { \
+ if (_info != &stg_BLACKHOLE_BQ_info) { \
+ DEBUG_FILL_SLOP(p1); \
+ ((StgIndOldGen *)p1)->mut_link = generations[bd->gen_no].mut_once_list; \
+ generations[bd->gen_no].mut_once_list = (StgMutClosure *)p1; \
+ } \
+ ((StgIndOldGen *)p1)->indirectee = p2; \
+ SET_INFO(p1, &stg_IND_OLDGEN_info); \
+ TICK_UPD_OLD_IND(); \
+ and_then; \
+ } \
+ }
#endif
/* The permanent indirection version isn't performance critical. We