X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fincludes%2FCmm.h;h=783b0e41bb0e7087e17aca46f7e1b0d8faed8c2d;hb=a0f46309637779ccc141ec531e9b128596a5bba0;hp=09320a0b7384d86af1cbc7f312894df941ef7035;hpb=ec0984a97cec59d0403ae1f23e23f100666e8148;p=ghc-hetmet.git diff --git a/ghc/includes/Cmm.h b/ghc/includes/Cmm.h index 09320a0..783b0e4 100644 --- a/ghc/includes/Cmm.h +++ b/ghc/includes/Cmm.h @@ -232,9 +232,11 @@ #define ENTER() \ again: \ + W_ info; \ + info = %INFO_PTR(R1); \ switch [INVALID_OBJECT .. N_CLOSURE_TYPES] \ - (TO_W_( %INFO_TYPE(%GET_STD_INFO(R1)) )) { \ - case \ + (TO_W_( %INFO_TYPE(%STD_INFO(info)) )) { \ + case \ IND, \ IND_OLDGEN, \ IND_PERM, \ @@ -244,7 +246,7 @@ R1 = StgInd_indirectee(R1); \ goto again; \ } \ - case \ + case \ BCO, \ FUN, \ FUN_1_0, \ @@ -259,7 +261,7 @@ } \ default: \ { \ - jump %GET_ENTRY(R1); \ + jump %ENTRY_CODE(info); \ } \ } @@ -292,6 +294,8 @@ #error mp_limb_t != StgWord: assumptions in PrimOps.cmm are now false #endif +#define MyCapability() (BaseReg - OFFSET_Capability_r) + /* ------------------------------------------------------------------------- Allocation and garbage collection ------------------------------------------------------------------------- */ @@ -317,8 +321,11 @@ HP_CHK_GEN(alloc,liveness,reentry); \ TICK_ALLOC_HEAP_NOCTR(alloc); +// allocateLocal() allocates from the nursery, so we check to see +// whether the nursery is nearly empty in any function that uses +// allocateLocal() - this includes many of the primops. #define MAYBE_GC(liveness,reentry) \ - if (CInt[alloc_blocks] >= CInt[alloc_blocks_lim]) { \ + if (bdescr_link(CurrentNursery) == NULL || CInt[alloc_blocks] >= CInt[alloc_blocks_lim]) { \ R9 = liveness; \ R10 = reentry; \ jump stg_gc_gen_hp; \ @@ -335,11 +342,7 @@ * the value from GHC, but it seems like too much trouble to do that * for StgThunkHeader. */ -#ifdef SMP #define SIZEOF_StgThunkHeader SIZEOF_StgHeader+SIZEOF_StgSMPThunkHeader -#else -#define SIZEOF_StgThunkHeader SIZEOF_StgHeader -#endif #define StgThunk_payload(__ptr__,__ix__) \ W_[__ptr__+SIZEOF_StgThunkHeader+ WDS(__ix__)] @@ -383,8 +386,8 @@ */ #define StgFunInfoExtra_slow_apply(fun_info) \ - (StgFunInfoExtraRev_slow_apply_offset(fun_info) \ - + (fun_info) + SIZEOF_StgFunInfoExtraRev + SIZEOF_StgInfoTable) + (TO_W_(StgFunInfoExtraRev_slow_apply_offset(fun_info)) \ + + (fun_info) + SIZEOF_StgFunInfoExtraRev + SIZEOF_StgInfoTable) #define StgFunInfoExtra_fun_type(i) StgFunInfoExtraRev_fun_type(i) #define StgFunInfoExtra_arity(i) StgFunInfoExtraRev_arity(i)