/* ----------------------------------------------------------------------------
- * $Id: InfoMacros.h,v 1.21 2002/12/11 15:36:37 simonmar Exp $
+ * $Id: InfoMacros.h,v 1.22 2003/05/14 09:14:01 simonmar Exp $
*
* (c) The GHC Team, 1998-2002
*
#ifndef INFOMACROS_H
#define INFOMACROS_H
-#define STD_INFO(srt_len_, type_) \
- srt_len : srt_len_, \
+#define STD_INFO(srt_bitmap_, type_) \
+ srt_bitmap : srt_bitmap_, \
type : type_
#define THUNK_INFO(srt_, srt_off_) \
INFO_TABLE_THUNK(info, /* info-table label */ \
entry, /* entry code label */ \
ptrs, nptrs, /* closure layout info */\
- srt_, srt_off_, srt_len_, /* SRT info */ \
+ srt_, srt_off_, srt_bitmap_, /* SRT info */ \
type, /* closure type */ \
info_class, entry_class, /* C storage classes */ \
prof_descr, prof_type) /* profiling info */ \
info_class const StgInfoTable stg_RBH_##info = { \
layout : { payload : {ptrs,nptrs} }, \
PROF_INFO(prof_type, prof_descr) \
- SRT_INFO(RBH,srt_,srt_off_,srt_len_), \
+ SRT_INFO(RBH,srt_,srt_off_,srt_bitmap_), \
INCLUDE_RBH_INFO(info), \
INIT_ENTRY(stg_RBH_##entry) \
} ; \
info_class const StgInfoTable info = { \
layout : { payload : {ptrs,nptrs} }, \
PROF_INFO(prof_type, prof_descr) \
- SRT_INFO(type,srt_,srt_off_,srt_len_), \
+ SRT_INFO(type,srt_,srt_off_,srt_bitmap_), \
INCLUDE_RBH_INFO(stg_RBH_##info), \
INIT_ENTRY(entry) \
}
INFO_TABLE_THUNK(info, /* info-table label */ \
entry, /* entry code label */ \
ptrs, nptrs, /* closure layout info */\
- srt_, srt_off_, srt_len_, /* SRT info */ \
+ srt_, srt_off_, srt_bitmap_, /* SRT info */ \
type_, /* closure type */ \
info_class, entry_class, /* C storage classes */ \
prof_descr, prof_type) /* profiling info */ \
i : { \
layout : { payload : {ptrs,nptrs} }, \
PROF_INFO(prof_type, prof_descr) \
- STD_INFO(srt_len_, type_), \
+ STD_INFO(srt_bitmap_, type_), \
INIT_ENTRY(entry) \
}, \
THUNK_INFO(srt_,srt_off_), \
#if defined(GRAN) || defined(PAR)
#define \
-INFO_TABLE_RET(info, entry, bitmap_, srt_, srt_off_, srt_len_, \
+INFO_TABLE_RET(info, entry, bitmap_, srt_, srt_off_, srt_bitmap_, \
type, info_class, entry_class, \
prof_descr, prof_type) \
entry_class(stg_RBH_##entry); \
info_class const StgInfoTable stg_RBH_##info = { \
layout : { bitmap : (StgWord)bitmap_ }, \
PROF_INFO(prof_type, prof_descr) \
- SRT_INFO(RBH,srt_,srt_off_,srt_len_), \
+ SRT_INFO(RBH,srt_,srt_off_,srt_bitmap_), \
INCLUDE_RBH_INFO(info), \
INIT_ENTRY(stg_RBH_##entry) \
}; \
info_class const StgInfoTable info = { \
layout : { bitmap : (StgWord)bitmap_ }, \
PROF_INFO(prof_type, prof_descr) \
- SRT_INFO(type,srt_,srt_off_,srt_len_), \
+ SRT_INFO(type,srt_,srt_off_,srt_bitmap_), \
INCLUDE_RBH_INFO(stg_RBH_##info), \
INIT_ENTRY(entry) \
}
#else
#define \
-INFO_TABLE_RET(info, entry, bitmap_, srt_, srt_off_, srt_len_, \
+INFO_TABLE_RET(info, entry, bitmap_, srt_, srt_off_, srt_bitmap_, \
type_, info_class, entry_class, \
prof_descr, prof_type) \
entry_class(entry); \
i : { \
layout : { bitmap : (StgWord)bitmap_ }, \
PROF_INFO(prof_type, prof_descr) \
- STD_INFO(srt_len_,type_), \
+ STD_INFO(srt_bitmap_,type_), \
INIT_ENTRY(entry) \
}, \
RET_INFO(srt_,srt_off_) \
INIT_ENTRY(entry) \
}
-#define constrTag(con) (get_itbl(con)->srt_len)
+#define constrTag(con) (get_itbl(con)->srt_bitmap)
/* function info table -----------------------------------------------------*/
INFO_TABLE_FUN_GEN(info, /* info-table label */ \
entry, /* entry code label */ \
ptrs, nptrs, /* closure layout info */\
- srt_, srt_off_, srt_len_, /* SRT info */ \
+ srt_, srt_off_, srt_bitmap_, /* SRT info */ \
fun_type_, arity_, bitmap_, slow_apply_, \
/* Function info */ \
type_, /* closure type */ \
i : { \
layout : { payload : {ptrs,nptrs} }, \
PROF_INFO(prof_type, prof_descr) \
- STD_INFO(srt_len_,type_), \
+ STD_INFO(srt_bitmap_,type_), \
INIT_ENTRY(entry) \
}, \
srt : (StgSRT *)((StgClosure **)srt_+srt_off_), \
StgRetInfoTable i;
} vec_info_8;
-#define VEC_INFO_2(info,bitmap_,srt_,srt_off_,srt_len_, \
+#define VEC_INFO_2(info,bitmap_,srt_,srt_off_,srt_bitmap_, \
type_, info_class, \
alt_1, alt_2) \
info_class const vec_info_2 info = { \
i : { \
i : { \
layout : { bitmap : (StgWord)bitmap_ }, \
- STD_INFO(srt_len_,type_) \
+ STD_INFO(srt_bitmap_,type_) \
}, \
RET_INFO(srt_,srt_off_) \
} \
}
-#define VEC_INFO_3(info,bitmap_,srt_,srt_off_,srt_len_, \
+#define VEC_INFO_3(info,bitmap_,srt_,srt_off_,srt_bitmap_, \
type_, info_class, \
alt_1, alt_2, alt_3 \
) \
i : { \
i : { \
layout : { bitmap : (StgWord)bitmap_ }, \
- STD_INFO(srt_len_,type_) \
+ STD_INFO(srt_bitmap_,type_) \
}, \
RET_INFO(srt_,srt_off_) \
} \
}
-#define VEC_INFO_4(info,bitmap_,srt_,srt_off_,srt_len_, \
+#define VEC_INFO_4(info,bitmap_,srt_,srt_off_,srt_bitmap_, \
type_, info_class, \
alt_1, alt_2, alt_3, alt_4 \
) \
i : { \
i : { \
layout : { bitmap : (StgWord)bitmap_ }, \
- STD_INFO(srt_len_,type_) \
+ STD_INFO(srt_bitmap_,type_) \
}, \
RET_INFO(srt_,srt_off_) \
} \
}
-#define VEC_INFO_5(info,bitmap_,srt_,srt_off_,srt_len_, \
+#define VEC_INFO_5(info,bitmap_,srt_,srt_off_,srt_bitmap_, \
type_, info_class, \
alt_1, alt_2, alt_3, alt_4, \
alt_5 \
i : { \
i : { \
layout : { bitmap : (StgWord)bitmap_ }, \
- STD_INFO(srt_len_,type_) \
+ STD_INFO(srt_bitmap_,type_) \
}, \
RET_INFO(srt_,srt_off_) \
} \
}
-#define VEC_INFO_6(info,bitmap_,srt_,srt_off_,srt_len_, \
+#define VEC_INFO_6(info,bitmap_,srt_,srt_off_,srt_bitmap_, \
type_, info_class, \
alt_1, alt_2, alt_3, alt_4, \
alt_5, alt_6 \
i : { \
i : { \
layout : { bitmap : (StgWord)bitmap_ }, \
- STD_INFO(srt_len_,type_) \
+ STD_INFO(srt_bitmap_,type_) \
}, \
RET_INFO(srt_,srt_off_) \
} \
}
-#define VEC_INFO_7(info,bitmap_,srt_,srt_off_,srt_len_, \
+#define VEC_INFO_7(info,bitmap_,srt_,srt_off_,srt_bitmap_, \
type_, info_class, \
alt_1, alt_2, alt_3, alt_4, \
alt_5, alt_6, alt_7 \
i : { \
i : { \
layout : { bitmap : (StgWord)bitmap_ }, \
- STD_INFO(srt_len_,type_) \
+ STD_INFO(srt_bitmap_,type_) \
}, \
RET_INFO(srt_,srt_off_) \
} \
}
-#define VEC_INFO_8(info,bitmap_,srt_,srt_off_,srt_len_, \
+#define VEC_INFO_8(info,bitmap_,srt_,srt_off_,srt_bitmap_, \
type_, info_class, \
alt_1, alt_2, alt_3, alt_4, \
alt_5, alt_6, alt_7, alt_8 \
i : { \
i : { \
layout : { bitmap : (StgWord)bitmap_ }, \
- STD_INFO(srt_len_,type_) \
+ STD_INFO(srt_bitmap_,type_) \
}, \
RET_INFO(srt_,srt_off_) \
} \
StgFunPtr vec[8];
} vec_info_8;
-#define VEC_INFO_2(info,bitmap_,srt_,srt_off_,srt_len_, \
+#define VEC_INFO_2(info,bitmap_,srt_,srt_off_,srt_bitmap_, \
type_, info_class, \
alt_1, alt_2) \
info_class const vec_info_2 info = { \
i : { \
i : { \
layout : { bitmap : (StgWord)bitmap_ }, \
- STD_INFO(srt_len_,type_) \
+ STD_INFO(srt_bitmap_,type_) \
}, \
RET_INFO(srt_,srt_off_) \
} \
}
-#define VEC_INFO_3(info,bitmap_,srt_,srt_off_,srt_len_, \
+#define VEC_INFO_3(info,bitmap_,srt_,srt_off_,srt_bitmap_, \
type_, info_class, \
alt_1, alt_2, alt_3 \
) \
i : { \
i : { \
layout : { bitmap : (StgWord)bitmap_ }, \
- STD_INFO(srt_len_,type_) \
+ STD_INFO(srt_bitmap_,type_) \
}, \
RET_INFO(srt_,srt_off_) \
}, \
vec : { alt_1, alt_2, alt_3 } \
}
-#define VEC_INFO_4(info,bitmap_,srt_,srt_off_,srt_len_, \
+#define VEC_INFO_4(info,bitmap_,srt_,srt_off_,srt_bitmap_, \
type_, info_class, \
alt_1, alt_2, alt_3, alt_4 \
) \
i : { \
i : { \
layout : { bitmap : (StgWord)bitmap_ }, \
- STD_INFO(srt_len_,type_) \
+ STD_INFO(srt_bitmap_,type_) \
}, \
RET_INFO(srt_,srt_off_) \
}, \
vec : { alt_1, alt_2, alt_3, alt_4 } \
}
-#define VEC_INFO_5(info,bitmap_,srt_,srt_off_,srt_len_, \
+#define VEC_INFO_5(info,bitmap_,srt_,srt_off_,srt_bitmap_, \
type_, info_class, \
alt_1, alt_2, alt_3, alt_4, \
alt_5 \
i : { \
i : { \
layout : { bitmap : (StgWord)bitmap_ }, \
- STD_INFO(srt_len_,type_) \
+ STD_INFO(srt_bitmap_,type_) \
}, \
RET_INFO(srt_,srt_off_) \
}, \
alt_5 } \
}
-#define VEC_INFO_6(info,bitmap_,srt_,srt_off_,srt_len_, \
+#define VEC_INFO_6(info,bitmap_,srt_,srt_off_,srt_bitmap_, \
type_, info_class, \
alt_1, alt_2, alt_3, alt_4, \
alt_5, alt_6 \
i : { \
i : { \
layout : { bitmap : (StgWord)bitmap_ }, \
- STD_INFO(srt_len_,type_) \
+ STD_INFO(srt_bitmap_,type_) \
}, \
RET_INFO(srt_,srt_off_) \
}, \
alt_5, alt_6 } \
}
-#define VEC_INFO_7(info,bitmap_,srt_,srt_off_,srt_len_, \
+#define VEC_INFO_7(info,bitmap_,srt_,srt_off_,srt_bitmap_, \
type_, info_class, \
alt_1, alt_2, alt_3, alt_4, \
alt_5, alt_6, alt_7 \
i : { \
i : { \
layout : { bitmap : (StgWord)bitmap_ }, \
- STD_INFO(srt_len_,type_) \
+ STD_INFO(srt_bitmap_,type_) \
}, \
RET_INFO(srt_,srt_off_) \
}, \
alt_5, alt_6, alt_7 } \
}
-#define VEC_INFO_8(info,bitmap_,srt_,srt_off_,srt_len_, \
+#define VEC_INFO_8(info,bitmap_,srt_,srt_off_,srt_bitmap_, \
type_, info_class, \
alt_1, alt_2, alt_3, alt_4, \
alt_5, alt_6, alt_7, alt_8 \
i : { \
i : { \
layout : { bitmap : (StgWord)bitmap_ }, \
- STD_INFO(srt_len_,type_) \
+ STD_INFO(srt_bitmap_,type_) \
}, \
RET_INFO(srt_,srt_off_) \
}, \
#ifndef TABLES_NEXT_TO_CODE
#define VEC_POLY_INFO_TABLE(nm, bitmap_, \
- srt_, srt_off_, srt_len_, \
+ srt_, srt_off_, srt_bitmap_, \
type_, info_class, entry_class \
) \
info_class const vec_info_8 nm##_info = { \
i : { \
layout : { \
bitmap : (StgWord)bitmap_ }, \
- STD_INFO(srt_len_, type_), \
+ STD_INFO(srt_bitmap_, type_), \
INIT_ENTRY(nm##_ret) \
}, \
RET_INFO(srt_,srt_off_) \
#else
#define VEC_POLY_INFO_TABLE(nm, bitmap_, \
- srt_, srt_off_, srt_len_, \
+ srt_, srt_off_, srt_bitmap_, \
type_, info_class, entry_class \
) \
info_class const vec_info_8 nm##_info = { \
i : { \
layout : { \
bitmap : (StgWord)bitmap_ }, \
- STD_INFO(srt_len_, type_), \
+ STD_INFO(srt_bitmap_, type_), \
INIT_ENTRY(nm##_ret) \
}, \
RET_INFO(srt_,srt_off_) \
#define SRT(lbl) \
static const StgSRT lbl = {
-#define BITMAP(lbl,size,contents) \
- static const StgLargeBitmap lbl = { size, { contents } };
-
-#if SIZEOF_VOID_P == 8
-#define BITMAP64(first, second) \
- (((StgWord32)(first)) | ((StgWord)(StgWord32)(second) << 32))
-#else
-#define BITMAP64(first, second) first, second
-#endif
-#define BITMAP32(x) ((StgWord32)(x))
-#define COMMA ,
-
/* DLL_SRT_ENTRY is used on the Win32 side when filling initialising
an entry in an SRT table with a reference to a closure that's
living in a DLL. See elsewhere for reasons as to why we need