[project @ 2005-03-10 14:03:28 by simonmar]
[ghc-hetmet.git] / ghc / includes / Cmm.h
index 608e97d..240b16a 100644 (file)
@@ -97,7 +97,7 @@
 
 #if SIZEOF_INT == 4
 #define CInt bits32
-#elif SIZEOF_INT = 8
+#elif SIZEOF_INT == 8
 #define CInt bits64
 #else
 #error Unknown int size
 
 #if SIZEOF_LONG == 4
 #define CLong bits32
-#elif SIZEOF_LONG = 8
+#elif SIZEOF_LONG == 8
 #define CLong bits64
 #else
 #error Unknown long size
 #define HALF_W_(x) %lobits32(x)
 #endif
 
+#if SIZEOF_INT == 4 && SIZEOF_W == 8
+#define W_TO_INT(x) %lobits32(x)
+#elif SIZEOF_INT == SIZEOF_W
+#define W_TO_INT(x) (x)
+#endif
+
 /* -----------------------------------------------------------------------------
    Heap/stack access, and adjusting the heap/stack pointers.
    -------------------------------------------------------------------------- */
        if (predicate) {                        \
            /*null*/;                           \
        } else {                                \
-           foreign "C" _stgAssert(NULL, __LINE__); \
+           foreign "C" _assertFail(NULL, __LINE__); \
         }
 #else
 #define ASSERT(p) /* nothing */
    TICK_ALLOC_HEAP_NOCTR(alloc);
 
 #define MAYBE_GC(liveness,reentry)                     \
-   if (CInt[alloc_blocks] >= CInt[alloc_blocks_lim]) { \
+   if (W_[alloc_blocks] >= W_[alloc_blocks_lim]) {     \
        R9  = liveness;                                 \
         R10 = reentry;                                 \
         jump stg_gc_gen_hp;                            \
 // macros which use the appropriate version here:
 //
 #ifdef TABLES_NEXT_TO_CODE
-#define StgFunInfoExtra_slow_apply(i) StgFunInfoExtraRev_slow_apply(i)
+        // when TABLES_NEXT_TO_CODE, slow_apply is stored as an offset
+        // instead of the normal pointer.
+        
+#define StgFunInfoExtra_slow_apply(fun_info)    \
+        (StgFunInfoExtraRev_slow_apply_offset(fun_info)    \
+        + (fun_info) + SIZEOF_StgFunInfoExtraRev + SIZEOF_StgInfoTable)
+
 #define StgFunInfoExtra_fun_type(i)   StgFunInfoExtraRev_fun_type(i)
 #define StgFunInfoExtra_arity(i)      StgFunInfoExtraRev_arity(i)
 #define StgFunInfoExtra_bitmap(i)     StgFunInfoExtraRev_bitmap(i)