diff --git a/rts/Schedule.c b/rts/Schedule.c index 9b1e98ea179438c47e31e65fa7bef69623e7c9f6..fa48bef1a7f3e04222201d235e1e464fc313cdf2 100644 --- a/rts/Schedule.c +++ b/rts/Schedule.c @@ -1315,9 +1315,7 @@ scheduleHandleThreadFinished (Capability *cap, Task *task, StgTSO *t) if (t->what_next == ThreadComplete) { if (task->incall->ret) { // NOTE: return val is stack->sp[1] (see StgStartup.cmm) - StgDeadThreadFrame *dead = (StgDeadThreadFrame *) &task->incall->tso->stackobj->sp[0]; - ASSERT(dead->header.info == &stg_dead_thread_info); - *(task->incall->ret) = (StgClosure *) dead->result; + *(task->incall->ret) = (StgClosure *)task->incall->tso->stackobj->sp[1]; } task->incall->rstat = Success; } else { diff --git a/rts/StgMiscClosures.cmm b/rts/StgMiscClosures.cmm index dbdd2d71facf14926b34f96cbf5804233654c108..b9aee516d0e572d330bbd59e5bd1440a8dc4153a 100644 --- a/rts/StgMiscClosures.cmm +++ b/rts/StgMiscClosures.cmm @@ -414,16 +414,6 @@ INFO_TABLE_RET( stg_apply_interp, RET_BCO ) jump stg_yield_to_interpreter []; } -/* - * Dummy info table pushed on the top of the stack when the stack's - * owning thread has finished. - */ -INFO_TABLE_RET( stg_dead_thread, RET_SMALL, - W_ info_ptr, - PROF_HDR_FIELDS(W_,p1,p2) - P_ result ) -{ foreign "C" barf("stg_dead_thread entered!") never returns; } - /* ---------------------------------------------------------------------------- Entry code for a BCO ------------------------------------------------------------------------- */ diff --git a/rts/StgStartup.cmm b/rts/StgStartup.cmm index 6d3d47f54fc58d4891c84d683647eb85790daa00..122eace1f3ceb7358f67f56e3f959e158bb799a2 100644 --- a/rts/StgStartup.cmm +++ b/rts/StgStartup.cmm @@ -51,13 +51,13 @@ INFO_TABLE_RET(stg_stop_thread, STOP_FRAME, We Leave the stack looking like this: - +----------------------+ - | -----------------------> return value - +----------------------+ - | stg_dead_thread_info | - +----------------------+ + +----------------+ + | -------------------> return value + +----------------+ + | stg_enter_info | + +----------------+ - The stg_dead_thread_info is just a dummy info table so that the + The stg_enter_info is just a dummy info table so that the garbage collector can understand the stack (there must always be an info table on top of the stack). */ @@ -70,9 +70,9 @@ INFO_TABLE_RET(stg_stop_thread, STOP_FRAME, unwind UnwindReturnReg = return; #endif - Sp = Sp + SIZEOF_StgStopFrame - SIZEOF_StgDeadThreadFrame; - Sp(0) = stg_dead_thread_info; + Sp = Sp + SIZEOF_StgStopFrame - WDS(2); Sp(1) = R1; + Sp(0) = stg_enter_info; StgTSO_what_next(CurrentTSO) = ThreadComplete::I16; diff --git a/rts/include/rts/storage/Closures.h b/rts/include/rts/storage/Closures.h index 09c7bfdb88f768c1624f5e57e0d2d41892b866a3..bfc8308c29403118ff2df159248f550412e4d0b0 100644 --- a/rts/include/rts/storage/Closures.h +++ b/rts/include/rts/storage/Closures.h @@ -285,13 +285,6 @@ typedef struct { StgHeader header; } StgStopFrame; -// Stack frame indicating that the stack's owning thread has finished. -// -// Closure types: RET_SMALL -typedef struct { - StgHeader header; - StgClosure *result; -} StgDeadThreadFrame; // A function return stack frame: used when saving the state for a // garbage collection at a function entry point. The function diff --git a/rts/include/stg/MiscClosures.h b/rts/include/stg/MiscClosures.h index b5efd9636b2735cb7cb29d0f449036099d53e643..e87eba09316d73ed50edc4f25ff9fbc3a6d6590f 100644 --- a/rts/include/stg/MiscClosures.h +++ b/rts/include/stg/MiscClosures.h @@ -159,7 +159,6 @@ RTS_RET(stg_ctoi_t61); RTS_RET(stg_ctoi_t62); RTS_RET(stg_apply_interp); -RTS_RET(stg_dead_thread); RTS_ENTRY(stg_IND); RTS_ENTRY(stg_IND_STATIC); diff --git a/utils/deriveConstants/Main.hs b/utils/deriveConstants/Main.hs index 1619f5588cb1ce5300eaf5356fa641404f369bed..9a57ecf68236567236f106b0d32b96001fa9646e 100644 --- a/utils/deriveConstants/Main.hs +++ b/utils/deriveConstants/Main.hs @@ -421,7 +421,6 @@ wanteds os = concat ,closureSize Both "StgUpdateFrame" ,closureSize C "StgCatchFrame" ,closureSize C "StgStopFrame" - ,closureSize C "StgDeadThreadFrame" ,closureSize Both "StgMutArrPtrs" ,closureField Both "StgMutArrPtrs" "ptrs"