[project @ 2005-06-06 08:49:07 by tharris]
[ghc-hetmet.git] / ghc / rts / GC.c
index fce011a..f75468f 100644 (file)
@@ -2871,6 +2871,9 @@ scavenge(step *stp)
        evac_gen = 0;
        tvar->current_value = evacuate((StgClosure*)tvar->current_value);
        tvar->first_wait_queue_entry = (StgTVarWaitQueue *)evacuate((StgClosure*)tvar->first_wait_queue_entry);
+#if defined(SMP)
+       tvar->last_update_by = (StgTRecHeader *)evacuate((StgClosure*)tvar->last_update_by);
+#endif
        evac_gen = saved_evac_gen;
        failed_to_evac = rtsTrue; // mutable
        p += sizeofW(StgTVar);
@@ -3216,6 +3219,9 @@ linear_scan:
            evac_gen = 0;
            tvar->current_value = evacuate((StgClosure*)tvar->current_value);
            tvar->first_wait_queue_entry = (StgTVarWaitQueue *)evacuate((StgClosure*)tvar->first_wait_queue_entry);
+#if defined(SMP)
+            tvar->last_update_by = (StgTRecHeader *)evacuate((StgClosure*)tvar->last_update_by);
+#endif
            evac_gen = saved_evac_gen;
            failed_to_evac = rtsTrue; // mutable
            break;
@@ -3528,6 +3534,9 @@ scavenge_one(StgPtr p)
        evac_gen = 0;
        tvar->current_value = evacuate((StgClosure*)tvar->current_value);
        tvar->first_wait_queue_entry = (StgTVarWaitQueue *)evacuate((StgClosure*)tvar->first_wait_queue_entry);
+#if defined(SMP)
+       tvar->last_update_by = (StgTRecHeader *)evacuate((StgClosure*)tvar->last_update_by);
+#endif
        evac_gen = saved_evac_gen;
        failed_to_evac = rtsTrue; // mutable
        break;
@@ -4208,27 +4217,13 @@ threadSqueezeStack(StgTSO *tso)
                    debugBelch("Unexpected lazy BHing required at 0x%04x",(int)bh);
 #endif
 #ifdef DEBUG
-                   /* zero out the slop so that the sanity checker can tell
-                    * where the next closure is.
-                    */
-                   { 
-                       StgInfoTable *bh_info = get_itbl(bh);
-                       nat np = bh_info->layout.payload.ptrs, 
-                           nw = bh_info->layout.payload.nptrs, i;
-                       /* don't zero out slop for a THUNK_SELECTOR,
-                        * because its layout info is used for a
-                        * different purpose, and it's exactly the
-                        * same size as a BLACKHOLE in any case.
-                        */
-                       if (bh_info->type != THUNK_SELECTOR) {
-                           for (i = 0; i < np + nw; i++) {
-                               ((StgClosure *)bh)->payload[i] = INVALID_OBJECT;
-                           }
-                       }
-                   }
+                   // zero out the slop so that the sanity checker can tell
+                   // where the next closure is.
+                   DEBUG_FILL_SLOP(bh);
 #endif
 #ifdef PROFILING
                    // We pretend that bh is now dead.
+                   // ToDo: is the slop filling the same as DEBUG_FILL_SLOP?
                    LDV_recordDead_FILL_SLOP_DYNAMIC((StgClosure *)bh);
 #endif
                    // Todo: maybe use SET_HDR() and remove LDV_RECORD_CREATE()?