%
% (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
%
-% $Id: AbsCSyn.lhs,v 1.53 2003/07/02 13:12:33 simonpj Exp $
+% $Id: AbsCSyn.lhs,v 1.54 2003/07/18 14:39:06 simonmar Exp $
%
\section[AbstractC]{Abstract C: the last stop before machine code}
-- dataToTag# primop -- *only* used in unregisterised builds.
-- (see AbsCUtils.dsCOpStmt)
| DATA_TO_TAGZH
+ | AWAKEN_BQ_CLOSURE -- possibly awaken a blocking quuee
+ -- (used for in-place updates)
| REGISTER_FOREIGN_EXPORT -- register a foreign exported fun
| REGISTER_IMPORT -- register an imported module
cStmtMacroText PUSH_UPD_FRAME = SLIT("PUSH_UPD_FRAME")
cStmtMacroText SET_TAG = SLIT("SET_TAG")
cStmtMacroText DATA_TO_TAGZH = SLIT("dataToTagzh")
+cStmtMacroText AWAKEN_BQ_CLOSURE = SLIT("AWAKEN_BQ_CLOSURE")
cStmtMacroText REGISTER_FOREIGN_EXPORT = SLIT("REGISTER_FOREIGN_EXPORT")
cStmtMacroText REGISTER_IMPORT = SLIT("REGISTER_IMPORT")
cStmtMacroText REGISTER_DIMPORT = SLIT("REGISTER_DIMPORT")
%
% (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
%
-% $Id: CgHeapery.lhs,v 1.37 2003/07/02 13:12:36 simonpj Exp $
+% $Id: CgHeapery.lhs,v 1.38 2003/07/18 14:39:06 simonmar Exp $
%
\section[CgHeapery]{Heap management functions}
Occasionally we can update a closure in place instead of allocating
new space for it. This is the function that does the business, assuming:
- - node points to the closure to be overwritten
-
- the new closure doesn't contain any pointers if we're
using a generational collector.
in
-- GENERATE THE CODE
absC ( mkAbstractCs (
- [ CInitHdr closure_info head use_cc 0{-no alloc-} ]
+ [
+ -- don't forget to AWAKEN_BQ_CLOSURE: even though we're
+ -- doing update-in-place, the thunk might still have been
+ -- blackholed and another thread might be waiting on it.
+ CMacroStmt AWAKEN_BQ_CLOSURE [head],
+ CInitHdr closure_info head use_cc 0{-no alloc-}
+ ]
++ (map do_move amodes_with_offsets)))
\end{code}
/* -----------------------------------------------------------------------------
- * $Id: Updates.h,v 1.31 2003/04/08 15:32:38 sof Exp $
+ * $Id: Updates.h,v 1.32 2003/07/18 14:39:05 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
Awaken any threads waiting on this computation
-------------------------------------------------------------------------- */
+#define AWAKEN_BQ_CLOSURE(closure) \
+ { \
+ const StgInfoTable *info; \
+ info = ((StgClosure *)closure)->header.info; \
+ AWAKEN_BQ(info,closure); \
+ }
+
#if defined(PAR)
/*