/* -----------------------------------------------------------------------------
- * $Id: StgMacros.h,v 1.8 1999/04/27 12:31:40 simonm Exp $
+ * $Id: StgMacros.h,v 1.12 1999/06/25 09:13:38 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
#define ED_RO_ extern const
#define ID_ extern
#define ID_RO_ extern const
-#define EI_ extern const StgInfoTable
-#define EDI_ extern DLLIMPORT const StgInfoTable
-#define II_ extern const StgInfoTable
+#define EI_ extern INFO_TBL_CONST StgInfoTable
+#define EDI_ extern DLLIMPORT INFO_TBL_CONST StgInfoTable
+#define II_ extern INFO_TBL_CONST StgInfoTable
#define EC_ extern StgClosure
#define EDC_ extern DLLIMPORT StgClosure
#define IC_ extern StgClosure
The extra subtraction of one word is because tags start at zero.
-------------------------------------------------------------------------- */
-#ifdef USE_MINIINTERPRETER
-#define RET_VEC(p,t) ((*(stgCast(StgInfoTable*,p)->vector))[t])
-#else
+#ifdef TABLES_NEXT_TO_CODE
#define RET_VEC(p,t) (*((P_)(p) - sizeofW(StgInfoTable) - t - 1))
+#else
+#define RET_VEC(p,t) (((StgInfoTable *)p)->vector[t])
#endif
/* -----------------------------------------------------------------------------
/* set the tag register (if we have one) */
#define SET_TAG(t) /* nothing */
-/* don't do eager blackholing for now */
-#define UPD_BH_UPDATABLE(thunk) /* nothing */
-#define UPD_BH_SINGLE_ENTRY(thunk) /* nothing */
+#ifdef EAGER_BLACKHOLING
+# define UPD_BH_UPDATABLE(thunk) \
+ TICK_UPD_BH_UPDATABLE(); \
+ SET_INFO((StgClosure *)thunk,&BLACKHOLE_info)
+# define UPD_BH_SINGLE_ENTRY(thunk) \
+ TICK_UPD_BH_SINGLE_ENTRY(); \
+ SET_INFO((StgClosure *)thunk,&SE_BLACKHOLE_info)
+#else /* !EAGER_BLACKHOLING */
+# define UPD_BH_UPDATABLE(thunk) /* nothing */
+# define UPD_BH_SINGLE_ENTRY(thunk) /* nothing */
+#endif /* EAGER_BLACKHOLING */
+
+#define UPD_FRAME_UPDATEE(p) (((StgUpdateFrame *)(p))->updatee)
+#define UPDATE_SU_FROM_UPD_FRAME(p) (Su=((StgUpdateFrame *)(p))->link)
/* -----------------------------------------------------------------------------
Moving Floats and Doubles
*/
#if sparc_TARGET_ARCH
-#define ASSIGN_DBL(dst,src) \
+#define ASSIGN_DBL(dst0,src) \
+ { StgPtr dst = (StgPtr)(dst0); \
__asm__("st %2,%0\n\tst %R2,%1" : "=m" (((P_)(dst))[0]), \
- "=m" (((P_)(dst))[1]) : "f" (src));
+ "=m" (((P_)(dst))[1]) : "f" (src)); \
+ }
-#define PK_DBL(src) \
- ( { register double d; \
+#define PK_DBL(src0) \
+ ( { StgPtr src = (StgPtr)(src0); \
+ register double d; \
__asm__("ld %1,%0\n\tld %2,%R0" : "=f" (d) : \
"m" (((P_)(src))[0]), "m" (((P_)(src))[1])); d; \
} )