[project @ 2003-10-01 10:57:39 by wolfgang]
[ghc-hetmet.git] / ghc / includes / StgMacros.h
index 8c319d7..4a5a985 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: StgMacros.h,v 1.52 2003/04/28 09:57:12 simonmar Exp $
+ * $Id: StgMacros.h,v 1.56 2003/08/05 14:01:34 simonpj Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -259,6 +259,13 @@ typedef StgWord StgWordArray[];
 #define RET_DYN_NONPTR_REGS_SIZE 10
 #define ALL_NON_PTRS 0xff
 
+// Sanity check that RESERVED_STACK_WORDS is reasonable.  We can't
+// just derive RESERVED_STACK_WORDS because it's used in Haskell code
+// too.
+#if RESERVED_STACK_WORDS != (3 + RET_DYN_BITMAP_SIZE + RET_DYN_NONPTR_REGS_SIZE)
+#error RESERVED_STACK_WORDS may be wrong!
+#endif
+
 #define LIVENESS_MASK(ptr_regs)  (ALL_NON_PTRS ^ (ptr_regs))
 
 // We can have up to 255 pointers and 255 nonpointers in the stack
@@ -438,6 +445,14 @@ EXTFUN_RTS(stg_gen_block);
 #   else
 // An object is replaced by a blackhole, so we fill the slop with zeros.
 // 
+// This looks like it can't work - we're overwriting the contents of
+// the THUNK with slop!  Perhaps this never worked??? --SDM
+// The problem is that with eager-black-holing we currently perform
+// the black-holing operation at the *beginning* of the basic block,
+// when we still need the contents of the thunk.
+// Perhaps the thing to do is to overwrite it at the *end* of the
+// basic block, when we've already sucked out the thunk's contents? -- SLPJ
+//
 // Todo: maybe use SET_HDR() and remove LDV_recordCreate()?
 // 
 #    define UPD_BH_UPDATABLE(info)             \
@@ -457,8 +472,6 @@ EXTFUN_RTS(stg_gen_block);
 #  define UPD_BH_SINGLE_ENTRY(thunk) /* nothing */
 #endif /* EAGER_BLACKHOLING */
 
-#define UPD_FRAME_UPDATEE(p)  ((P_)(((StgUpdateFrame *)(p))->updatee))
-
 /* -----------------------------------------------------------------------------
    Moving Floats and Doubles