projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[project @ 2006-01-17 16:13:18 by simonmar]
[ghc-hetmet.git]
/
ghc
/
rts
/
LdvProfile.c
diff --git
a/ghc/rts/LdvProfile.c
b/ghc/rts/LdvProfile.c
index
7db8903
..
dfdda28
100644
(file)
--- a/
ghc/rts/LdvProfile.c
+++ b/
ghc/rts/LdvProfile.c
@@
-1,5
+1,4
@@
/* -----------------------------------------------------------------------------
/* -----------------------------------------------------------------------------
- * $Id: LdvProfile.c,v 1.6 2003/11/12 17:49:08 sof Exp $
*
* (c) The GHC Team, 2001
* Author: Sungwoo Park
*
* (c) The GHC Team, 2001
* Author: Sungwoo Park
@@
-10,7
+9,6
@@
#ifdef PROFILING
#ifdef PROFILING
-#include "Stg.h"
#include "Rts.h"
#include "LdvProfile.h"
#include "RtsFlags.h"
#include "Rts.h"
#include "LdvProfile.h"
#include "RtsFlags.h"
@@
-50,22
+48,25
@@
LDV_recordDead_FILL_SLOP_DYNAMIC( StgClosure *p )
switch (info->type) {
case THUNK_1_0:
case THUNK_0_1:
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:
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;
break;
+
case THUNK:
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:
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:
break;
case AP_STACK:
- nw = sizeofW(StgAP_STACK) - sizeofW(StgHeader)
+ nw = sizeofW(StgAP_STACK) - sizeofW(StgThunkHeader)
+ ((StgAP_STACK *)p)->size;
break;
case CAF_BLACKHOLE:
+ ((StgAP_STACK *)p)->size;
break;
case CAF_BLACKHOLE:
@@
-125,8
+126,10
@@
processHeapClosureForDead( StgClosure *c )
size = sizeofW(StgMVar);
return size;
size = sizeofW(StgMVar);
return size;
- case MUT_ARR_PTRS:
+ case MUT_ARR_PTRS_CLEAN:
+ case MUT_ARR_PTRS_DIRTY:
case MUT_ARR_PTRS_FROZEN:
case MUT_ARR_PTRS_FROZEN:
+ case MUT_ARR_PTRS_FROZEN0:
size = mut_arr_ptrs_sizeW((StgMutArrPtrs *)c);
return size;
size = mut_arr_ptrs_sizeW((StgMutArrPtrs *)c);
return size;
@@
-135,9
+138,8
@@
processHeapClosureForDead( StgClosure *c )
return size;
case WEAK:
return size;
case WEAK:
- case MUT_VAR:
- case MUT_CONS:
- case FOREIGN:
+ case MUT_VAR_CLEAN:
+ case MUT_VAR_DIRTY:
case BCO:
case STABLE_NAME:
size = sizeW_fromITBL(info);
case BCO:
case STABLE_NAME:
size = sizeW_fromITBL(info);
@@
-153,14
+155,20
@@
processHeapClosureForDead( StgClosure *c )
case THUNK_1_0:
case THUNK_0_1:
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_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:
break;
case AP:
+ size = ap_sizeW((StgAP *)c);
+ break;
+
case PAP:
size = pap_sizeW((StgPAP *)c);
break;
case PAP:
size = pap_sizeW((StgPAP *)c);
break;
@@
-183,7
+191,6
@@
processHeapClosureForDead( StgClosure *c )
case FUN_1_1:
case FUN_0_2:
case FUN_1_1:
case FUN_0_2:
- case BLACKHOLE_BQ:
case BLACKHOLE:
case SE_BLACKHOLE:
case CAF_BLACKHOLE:
case BLACKHOLE:
case SE_BLACKHOLE:
case CAF_BLACKHOLE:
@@
-192,11
+199,8
@@
processHeapClosureForDead( StgClosure *c )
break;
case IND_PERM:
break;
case IND_PERM:
- size = sizeofW(StgInd);
- break;
-
case IND_OLDGEN_PERM:
case IND_OLDGEN_PERM:
- size = sizeofW(StgIndOldGen);
+ size = sizeofW(StgInd);
break;
/*
break;
/*
@@
-209,11
+213,8
@@
processHeapClosureForDead( StgClosure *c )
// because they will perish before the next census at any
// rate.
case IND:
// because they will perish before the next census at any
// rate.
case IND:
- size = sizeofW(StgInd);
- return size;
-
case IND_OLDGEN:
case IND_OLDGEN:
- size = sizeofW(StgIndOldGen);
+ size = sizeofW(StgInd);
return size;
case EVACUATED:
return size;
case EVACUATED:
@@
-290,7
+291,7
@@
processNurseryForDead( void )
StgPtr p, bdLimit;
bdescr *bd;
StgPtr p, bdLimit;
bdescr *bd;
- bd = MainCapability.r.rNursery;
+ bd = MainCapability.r.rNursery->blocks;
while (bd->start < bd->free) {
p = bd->start;
bdLimit = bd->start + BLOCK_SIZE_W;
while (bd->start < bd->free) {
p = bd->start;
bdLimit = bd->start + BLOCK_SIZE_W;