X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fincludes%2FUpdates.h;h=37b8ecc62d3eb9631fd3c87b96d095218ab8861a;hb=0d52a0a134871d317b5f8b53a952c882ce5ae5b6;hp=1f1203068bcc9776579ef312d260bbd1b58aa2f4;hpb=5ef7bcaa0b87744d3fc6eb6a076db0b76a40a625;p=ghc-hetmet.git diff --git a/ghc/includes/Updates.h b/ghc/includes/Updates.h index 1f12030..37b8ecc 100644 --- a/ghc/includes/Updates.h +++ b/ghc/includes/Updates.h @@ -40,11 +40,15 @@ * 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 @@ -56,43 +60,51 @@ /* 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) \ + BLOCK_BEGIN \ DECLARE_IPTR(info); \ info = GET_INFO(updclosure); \ AWAKEN_BQ_NOLOCK(info,updclosure); \ updateWithIndirection(info, INFO_PTR(stg_IND_info), \ updclosure, \ - heapptr,); + heapptr,); \ + BLOCK_END # endif #else @@ -226,7 +238,7 @@ extern void awakenBlockedQueue(StgBlockingQueueElement *q, StgClosure *node); inf = %GET_STD_INFO(p); \ np = TO_W_(%INFO_PTRS(inf)); \ nw = TO_W_(%INFO_NPTRS(inf)); \ - if (%INFO_TYPE(inf) != THUNK_SELECTOR::I16) { \ + if (%INFO_TYPE(inf) != HALF_W_(THUNK_SELECTOR)) { \ i = 0; \ for: \ if (i < np + nw) { \ @@ -273,7 +285,7 @@ DEBUG_FILL_SLOP(StgClosure *p) /* ASSERT( p1 != p2 && !closure_IND(p1) ); \ */ LDV_RECORD_DEAD_FILL_SLOP_DYNAMIC(p1); \ bd = Bdescr(p1); \ - if (bdescr_gen_no(bd) == 0) { \ + if (bdescr_gen_no(bd) == 0 :: CInt) { \ StgInd_indirectee(p1) = p2; \ SET_INFO(p1, ind_info); \ LDV_RECORD_CREATE(p1); \ @@ -283,7 +295,7 @@ DEBUG_FILL_SLOP(StgClosure *p) if (info != stg_BLACKHOLE_BQ_info) { \ DEBUG_FILL_SLOP(p1); \ W_ __mut_once_list; \ - __mut_once_list = generation(bdescr_gen_no(bd)) + \ + __mut_once_list = generation(TO_W_(bdescr_gen_no(bd))) + \ OFFSET_generation_mut_once_list; \ StgMutClosure_mut_link(p1) = W_[__mut_once_list]; \ W_[__mut_once_list] = p1; \