summaryrefslogtreecommitdiff
path: root/rts
diff options
context:
space:
mode:
authorsimonmar@microsoft.com <unknown>2008-02-18 13:54:58 +0000
committersimonmar@microsoft.com <unknown>2008-02-18 13:54:58 +0000
commit5801be78034f83a82527e5b035a540b4cf9741eb (patch)
treecaf71e6753ded39eb1ce767b7ea6944005813931 /rts
parente4a88996229ea561d19ba20ef96740efba9eb367 (diff)
downloadhaskell-5801be78034f83a82527e5b035a540b4cf9741eb.tar.gz
refactoring
Diffstat (limited to 'rts')
-rw-r--r--rts/sm/Scav.c40
1 files changed, 14 insertions, 26 deletions
diff --git a/rts/sm/Scav.c b/rts/sm/Scav.c
index 0f06ee95ab..1640eddabf 100644
--- a/rts/sm/Scav.c
+++ b/rts/sm/Scav.c
@@ -134,6 +134,10 @@ scavenge_fun_srt(const StgInfoTable *info)
static void
scavengeTSO (StgTSO *tso)
{
+ rtsBool saved_eager = gct->eager_promotion;
+
+ gct->eager_promotion = rtsFalse;
+
if ( tso->why_blocked == BlockedOnMVar
|| tso->why_blocked == BlockedOnBlackHole
|| tso->why_blocked == BlockedOnException
@@ -154,6 +158,14 @@ scavengeTSO (StgTSO *tso)
// scavenge this thread's stack
scavenge_stack(tso->sp, &(tso->stack[tso->stack_size]));
+
+ if (gct->failed_to_evac) {
+ tso->flags |= TSO_DIRTY;
+ } else {
+ tso->flags &= ~TSO_DIRTY;
+ }
+
+ gct->eager_promotion = saved_eager;
}
/* -----------------------------------------------------------------------------
@@ -494,19 +506,7 @@ linear_scan:
case TSO:
{
- StgTSO *tso = (StgTSO *)p;
- rtsBool saved_eager = gct->eager_promotion;
-
- gct->eager_promotion = rtsFalse;
- scavengeTSO(tso);
- gct->eager_promotion = saved_eager;
-
- if (gct->failed_to_evac) {
- tso->flags |= TSO_DIRTY;
- } else {
- tso->flags &= ~TSO_DIRTY;
- }
-
+ scavengeTSO((StgTSO*)p);
gct->failed_to_evac = rtsTrue; // always on the mutable list
break;
}
@@ -826,19 +826,7 @@ scavenge_one(StgPtr p)
case TSO:
{
- StgTSO *tso = (StgTSO *)p;
- rtsBool saved_eager = gct->eager_promotion;
-
- gct->eager_promotion = rtsFalse;
- scavengeTSO(tso);
- gct->eager_promotion = saved_eager;
-
- if (gct->failed_to_evac) {
- tso->flags |= TSO_DIRTY;
- } else {
- tso->flags &= ~TSO_DIRTY;
- }
-
+ scavengeTSO((StgTSO*)p);
gct->failed_to_evac = rtsTrue; // always on the mutable list
break;
}