X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FLdvProfile.c;h=9d21f6ab9a028120facf1a1a3ef529bd3d6f0fa4;hb=55472d778c441b65e013d27f5228283eef85986c;hp=e325374d17404fd676c8589ded50b25faeb9b63c;hpb=858255ab48783ac56fe13cf75a32ccfee3372b26;p=ghc-hetmet.git diff --git a/ghc/rts/LdvProfile.c b/ghc/rts/LdvProfile.c index e325374..9d21f6a 100644 --- a/ghc/rts/LdvProfile.c +++ b/ghc/rts/LdvProfile.c @@ -1,5 +1,4 @@ /* ----------------------------------------------------------------------------- - * $Id: LdvProfile.c,v 1.4 2003/01/30 10:06:35 simonmar Exp $ * * (c) The GHC Team, 2001 * Author: Sungwoo Park @@ -10,12 +9,9 @@ #ifdef PROFILING -#include "Stg.h" #include "Rts.h" #include "LdvProfile.h" #include "RtsFlags.h" -#include "Itimer.h" -#include "Proftimer.h" #include "Profiling.h" #include "Stats.h" #include "Storage.h" @@ -52,22 +48,25 @@ LDV_recordDead_FILL_SLOP_DYNAMIC( StgClosure *p ) switch (info->type) { case THUNK_1_0: case THUNK_0_1: + nw = stg_max(MIN_UPD_SIZE,1); + break; + case THUNK_2_0: case THUNK_1_1: case THUNK_0_2: case THUNK_SELECTOR: - nw = MIN_UPD_SIZE; + nw = stg_max(MIN_UPD_SIZE,2); break; + case THUNK: - nw = info->layout.payload.ptrs + info->layout.payload.nptrs; - if (nw < MIN_UPD_SIZE) - nw = MIN_UPD_SIZE; + nw = stg_max(info->layout.payload.ptrs + info->layout.payload.nptrs, + MIN_UPD_SIZE); break; case AP: - nw = sizeofW(StgPAP) - sizeofW(StgHeader) + ((StgPAP *)p)->n_args; + nw = sizeofW(StgAP) - sizeofW(StgThunkHeader) + ((StgPAP *)p)->n_args; break; case AP_STACK: - nw = sizeofW(StgAP_STACK) - sizeofW(StgHeader) + nw = sizeofW(StgAP_STACK) - sizeofW(StgThunkHeader) + ((StgAP_STACK *)p)->size; break; case CAF_BLACKHOLE: @@ -96,7 +95,7 @@ LDV_recordDead_FILL_SLOP_DYNAMIC( StgClosure *p ) * closure. Returns the size of the closure, including the profiling * header portion, so that the caller can find the next closure. * ----------------------------------------------------------------------- */ -static inline nat +STATIC_INLINE nat processHeapClosureForDead( StgClosure *c ) { nat size; @@ -138,7 +137,6 @@ processHeapClosureForDead( StgClosure *c ) case WEAK: case MUT_VAR: - case MUT_CONS: case FOREIGN: case BCO: case STABLE_NAME: @@ -155,14 +153,20 @@ processHeapClosureForDead( StgClosure *c ) case THUNK_1_0: case THUNK_0_1: + case THUNK_SELECTOR: + size = sizeofW(StgHeader) + stg_max(MIN_UPD_SIZE, 1); + break; + case THUNK_2_0: case THUNK_1_1: case THUNK_0_2: - case THUNK_SELECTOR: - size = sizeofW(StgHeader) + MIN_UPD_SIZE; + size = sizeofW(StgHeader) + stg_max(MIN_UPD_SIZE, 2); break; case AP: + size = ap_sizeW((StgAP *)c); + break; + case PAP: size = pap_sizeW((StgPAP *)c); break; @@ -185,7 +189,6 @@ processHeapClosureForDead( StgClosure *c ) case FUN_1_1: case FUN_0_2: - case BLACKHOLE_BQ: case BLACKHOLE: case SE_BLACKHOLE: case CAF_BLACKHOLE: @@ -194,11 +197,8 @@ processHeapClosureForDead( StgClosure *c ) break; case IND_PERM: - size = sizeofW(StgInd); - break; - case IND_OLDGEN_PERM: - size = sizeofW(StgIndOldGen); + size = sizeofW(StgInd); break; /* @@ -211,11 +211,8 @@ processHeapClosureForDead( StgClosure *c ) // because they will perish before the next census at any // rate. case IND: - size = sizeofW(StgInd); - return size; - case IND_OLDGEN: - size = sizeofW(StgIndOldGen); + size = sizeofW(StgInd); return size; case EVACUATED: