/* -----------------------------------------------------------------------------
- * $Id: GCCompact.c,v 1.15 2003/03/24 16:18:26 simonmar Exp $
+ * $Id: GCCompact.c,v 1.18 2003/11/12 17:49:07 sof Exp $
*
* (c) The GHC Team 2001
*
// Turn off inlining when debugging - it obfuscates things
#ifdef DEBUG
-#define INLINE
-#else
-#define INLINE inline
+# undef STATIC_INLINE
+# define STATIC_INLINE static
#endif
/* -----------------------------------------------------------------------------
except for the info pointer.
-------------------------------------------------------------------------- */
-static INLINE void
+STATIC_INLINE void
thread( StgPtr p )
{
StgPtr q = (StgPtr)*p;
}
}
-static INLINE void
+STATIC_INLINE void
unthread( StgPtr p, StgPtr free )
{
StgPtr q = (StgPtr)*p, r;
*p = (StgWord)q;
}
-static INLINE StgInfoTable *
+STATIC_INLINE StgInfoTable *
get_threaded_info( StgPtr p )
{
StgPtr q = (P_)GET_INFO((StgClosure *)p);
// A word-aligned memmove will be faster for small objects than libc's or gcc's.
// Remember, the two regions *might* overlap, but: to <= from.
-static INLINE void
+STATIC_INLINE void
move(StgPtr to, StgPtr from, nat size)
{
for(; size > 0; --size) {
}
}
-static INLINE nat
+STATIC_INLINE nat
obj_sizeW( StgClosure *p, StgInfoTable *info )
{
switch (info->type) {
}
}
-static INLINE void
+STATIC_INLINE void
thread_large_bitmap( StgPtr p, StgLargeBitmap *large_bitmap, nat size )
{
nat i, b;
}
}
-static INLINE StgPtr
+STATIC_INLINE StgPtr
thread_arg_block (StgFunInfoTable *fun_info, StgClosure **args)
{
StgPtr p;
// traverse the bitmap first
bitmap = GET_LIVENESS(dyn);
p = (P_)&((StgRetDyn *)p)->payload[0];
- size = RET_DYN_SIZE;
+ size = RET_DYN_BITMAP_SIZE;
while (size > 0) {
if ((bitmap & 1) == 0) {
thread(p);
}
// skip over the non-ptr words
- p += GET_NONPTRS(dyn);
+ p += GET_NONPTRS(dyn) + RET_DYN_NONPTR_REGS_SIZE;
// follow the ptr words
for (size = GET_PTRS(dyn); size > 0; size--) {
nat size;
p++;
- thread(p);
bco = (StgBCO *)*p;
+ thread(p);
p++;
size = BCO_BITMAP_SIZE(bco);
thread_large_bitmap(p, BCO_BITMAP(bco), size);
}
}
-static INLINE StgPtr
+STATIC_INLINE StgPtr
thread_PAP (StgPAP *pap)
{
StgPtr p;
return p;
}
-static INLINE StgPtr
+STATIC_INLINE StgPtr
thread_AP_STACK (StgAP_STACK *ap)
{
thread((StgPtr)&ap->fun);
}
}
-static INLINE StgPtr
+STATIC_INLINE StgPtr
thread_obj (StgInfoTable *info, StgPtr p)
{
switch (info->type) {
default:
barf("update_fwd: unknown/strange object %d", (int)(info->type));
+ return NULL;
}
}