X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fincludes%2FInfoMacros.h;h=1280bad5ff71165aa4483572906cb694dcbfcbb3;hb=2011da8dabbf5cbe57e4fc1e0ee3012634cd4d8f;hp=7e64899f0191734b5a6223d8bfe69d6d07fa640e;hpb=fda822c6090472110b7cd7ab76ea95ca07299f5c;p=ghc-hetmet.git diff --git a/ghc/includes/InfoMacros.h b/ghc/includes/InfoMacros.h index 7e64899..1280bad 100644 --- a/ghc/includes/InfoMacros.h +++ b/ghc/includes/InfoMacros.h @@ -1,5 +1,5 @@ /* ---------------------------------------------------------------------------- - * $Id: InfoMacros.h,v 1.12 2000/05/26 10:14:33 sewardj Exp $ + * $Id: InfoMacros.h,v 1.19 2002/06/03 12:56:41 matthewc Exp $ * * (c) The GHC Team, 1998-1999 * @@ -35,12 +35,6 @@ #define PROF_INFO(type_str, desc_str) #endif -#ifdef USE_MINIINTERPRETER -#define INIT_VECTOR {} -#else -#define INIT_VECTOR -#endif - /* On the GranSim/GUM specific parts of the InfoTables (GRAN/PAR): @@ -78,25 +72,27 @@ INFO_TABLE_SRT(info, /* info-table label */ \ type, /* closure type */ \ info_class, entry_class, /* C storage classes */ \ prof_descr, prof_type) /* profiling info */ \ - entry_class(RBH_##entry); \ + entry_class(stg_RBH_##entry); \ entry_class(entry); \ ED_RO_ StgInfoTable info; \ - info_class INFO_TBL_CONST StgInfoTable RBH_##info = { \ + info_class INFO_TBL_CONST StgInfoTable stg_RBH_##info = { \ layout : { payload : {ptrs,nptrs} }, \ PROF_INFO(prof_type, prof_descr) \ SRT_INFO(RBH,srt_,srt_off_,srt_len_), \ INCLUDE_RBH_INFO(info), \ - INIT_ENTRY(RBH_##entry), \ - INIT_VECTOR \ + INIT_ENTRY(stg_RBH_##entry), \ } ; \ - StgFunPtr RBH_##entry (void) { JMP_(RBH_entry); } ; \ + StgFunPtr stg_RBH_##entry (void) { \ + FB_ \ + JMP_(stg_RBH_entry); \ + FE_ \ + } ; \ info_class INFO_TBL_CONST StgInfoTable info = { \ layout : { payload : {ptrs,nptrs} }, \ PROF_INFO(prof_type, prof_descr) \ SRT_INFO(type,srt_,srt_off_,srt_len_), \ - INCLUDE_RBH_INFO(RBH_##info), \ + INCLUDE_RBH_INFO(stg_RBH_##info), \ INIT_ENTRY(entry), \ - INIT_VECTOR \ } #else @@ -115,7 +111,6 @@ INFO_TABLE_SRT(info, /* info-table label */ \ PROF_INFO(prof_type, prof_descr) \ SRT_INFO(type,srt_,srt_off_,srt_len_), \ INIT_ENTRY(entry), \ - INIT_VECTOR \ } #endif @@ -128,26 +123,29 @@ INFO_TABLE_SRT(info, /* info-table label */ \ INFO_TABLE_SRT_BITMAP(info, entry, bitmap_, srt_, srt_off_, srt_len_, \ type, info_class, entry_class, \ prof_descr, prof_type) \ - entry_class(RBH_##entry); \ + entry_class(stg_RBH_##entry); \ entry_class(entry); \ ED_RO_ StgInfoTable info; \ - info_class INFO_TBL_CONST StgInfoTable RBH_##info = { \ - layout : { bitmap : (StgWord32)bitmap_ }, \ + info_class INFO_TBL_CONST StgInfoTable stg_RBH_##info = { \ + layout : { bitmap : (StgWord)bitmap_ }, \ PROF_INFO(prof_type, prof_descr) \ SRT_INFO(RBH,srt_,srt_off_,srt_len_), \ INCLUDE_RBH_INFO(info), \ - INIT_ENTRY(RBH_##entry), \ - INIT_VECTOR \ + INIT_ENTRY(stg_RBH_##entry), \ }; \ - StgFunPtr RBH_##entry (void) { JMP_(RBH_entry); } ; \ + StgFunPtr stg_RBH_##entry (void) { \ + FB_ \ + JMP_(stg_RBH_entry); \ + FE_ \ + } ; \ info_class INFO_TBL_CONST StgInfoTable info = { \ - layout : { bitmap : (StgWord32)bitmap_ }, \ + layout : { bitmap : (StgWord)bitmap_ }, \ PROF_INFO(prof_type, prof_descr) \ SRT_INFO(type,srt_,srt_off_,srt_len_), \ - INCLUDE_RBH_INFO(RBH_##info), \ + INCLUDE_RBH_INFO(stg_RBH_##info), \ INIT_ENTRY(entry), \ - INIT_VECTOR \ } + #else #define \ @@ -156,11 +154,10 @@ INFO_TABLE_SRT_BITMAP(info, entry, bitmap_, srt_, srt_off_, srt_len_, \ prof_descr, prof_type) \ entry_class(entry); \ info_class INFO_TBL_CONST StgInfoTable info = { \ - layout : { bitmap : (StgWord32)bitmap_ }, \ + layout : { bitmap : (StgWord)bitmap_ }, \ PROF_INFO(prof_type, prof_descr) \ SRT_INFO(type,srt_,srt_off_,srt_len_), \ INIT_ENTRY(entry), \ - INIT_VECTOR \ } #endif @@ -171,25 +168,27 @@ INFO_TABLE_SRT_BITMAP(info, entry, bitmap_, srt_, srt_off_, srt_len_, \ #define \ INFO_TABLE(info, entry, ptrs, nptrs, type, info_class, \ entry_class, prof_descr, prof_type) \ - entry_class(RBH_##entry); \ + entry_class(stg_RBH_##entry); \ entry_class(entry); \ - ED_RO_ StgInfoTable info; \ - info_class INFO_TBL_CONST StgInfoTable RBH_##info = { \ + ED_ StgInfoTable info; \ + info_class INFO_TBL_CONST StgInfoTable stg_RBH_##info = { \ layout : { payload : {ptrs,nptrs} }, \ PROF_INFO(prof_type, prof_descr) \ STD_INFO(RBH), \ - INCLUDE_RBH_INFO(info), \ - INIT_ENTRY(RBH_##entry), \ - INIT_VECTOR \ - }; \ - StgFunPtr RBH_##entry (void) { JMP_(RBH_entry); } ; \ - info_class INFO_TBL_CONST StgInfoTable info = { \ + INCLUDE_RBH_INFO(info), \ + INIT_ENTRY(stg_RBH_##entry), \ + } ; \ + StgFunPtr stg_RBH_##entry (void) { \ + FB_ \ + JMP_(stg_RBH_entry); \ + FE_ \ + } ; \ + info_class INFO_TBL_CONST StgInfoTable info = { \ layout : { payload : {ptrs,nptrs} }, \ PROF_INFO(prof_type, prof_descr) \ STD_INFO(type), \ - INCLUDE_RBH_INFO(RBH_##info), \ + INCLUDE_RBH_INFO(stg_RBH_##info), \ INIT_ENTRY(entry), \ - INIT_VECTOR \ } #else @@ -203,7 +202,6 @@ INFO_TABLE(info, entry, ptrs, nptrs, type, info_class, \ PROF_INFO(prof_type, prof_descr) \ STD_INFO(type), \ INIT_ENTRY(entry), \ - INIT_VECTOR \ } #endif @@ -215,25 +213,27 @@ INFO_TABLE(info, entry, ptrs, nptrs, type, info_class, \ #define \ INFO_TABLE_SELECTOR(info, entry, offset, info_class, \ entry_class, prof_descr, prof_type) \ - entry_class(RBH_##entry); \ + entry_class(stg_RBH_##entry); \ entry_class(entry); \ ED_RO_ StgInfoTable info; \ - info_class INFO_TBL_CONST StgInfoTable RBH_##info = { \ + info_class INFO_TBL_CONST StgInfoTable stg_RBH_##info = { \ layout : { selector_offset : offset }, \ PROF_INFO(prof_type, prof_descr) \ STD_INFO(RBH), \ INCLUDE_RBH_INFO(info), \ - INIT_ENTRY(RBH_##entry), \ - INIT_VECTOR \ + INIT_ENTRY(stg_RBH_##entry), \ }; \ - StgFunPtr RBH_##entry (void) { JMP_(RBH_entry); } ; \ + StgFunPtr stg_RBH_##entry (void) { \ + FB_ \ + JMP_(stg_RBH_entry); \ + FE_ \ + } ; \ info_class INFO_TBL_CONST StgInfoTable info = { \ layout : { selector_offset : offset }, \ PROF_INFO(prof_type, prof_descr) \ STD_INFO(THUNK_SELECTOR), \ - INCLUDE_RBH_INFO(RBH_##info), \ + INCLUDE_RBH_INFO(stg_RBH_##info), \ INIT_ENTRY(entry), \ - INIT_VECTOR \ } #else @@ -247,7 +247,6 @@ INFO_TABLE_SELECTOR(info, entry, offset, info_class, \ PROF_INFO(prof_type, prof_descr) \ STD_INFO(THUNK_SELECTOR), \ INIT_ENTRY(entry), \ - INIT_VECTOR \ } #endif @@ -263,7 +262,6 @@ INFO_TABLE_CONSTR(info, entry, ptrs, nptrs, tag_,type_,info_class, \ PROF_INFO(prof_type, prof_descr) \ CONSTR_INFO(type_,tag_), \ INIT_ENTRY(entry), \ - INIT_VECTOR \ } #define constrTag(con) (get_itbl(con)->srt_len) @@ -320,7 +318,7 @@ typedef struct { info_class INFO_TBL_CONST vec_info_2 info = { \ { alt_2, alt_1 }, \ i : { \ - layout : { bitmap : (StgWord32)bitmap_ }, \ + layout : { bitmap : (StgWord)bitmap_ }, \ SRT_INFO(type,srt_,srt_off_,srt_len_) \ } \ } @@ -332,7 +330,7 @@ typedef struct { info_class INFO_TBL_CONST vec_info_3 info = { \ { alt_3, alt_2, alt_1 }, \ i : { \ - layout : { bitmap : (StgWord32)bitmap_ }, \ + layout : { bitmap : (StgWord)bitmap_ }, \ SRT_INFO(type,srt_,srt_off_,srt_len_) \ } \ } @@ -344,7 +342,7 @@ typedef struct { info_class INFO_TBL_CONST vec_info_4 info = { \ { alt_4, alt_3, alt_2, alt_1 }, \ i : { \ - layout : { bitmap : (StgWord32)bitmap_ }, \ + layout : { bitmap : (StgWord)bitmap_ }, \ SRT_INFO(type,srt_,srt_off_,srt_len_) \ } \ } @@ -358,7 +356,7 @@ typedef struct { { alt_5, alt_4, alt_3, alt_2, \ alt_1 }, \ i : { \ - layout : { bitmap : (StgWord32)bitmap_ }, \ + layout : { bitmap : (StgWord)bitmap_ }, \ SRT_INFO(type,srt_,srt_off_,srt_len_) \ } \ } @@ -372,7 +370,7 @@ typedef struct { { alt_6, alt_5, alt_4, alt_3, \ alt_2, alt_1 }, \ i : { \ - layout : { bitmap : (StgWord32)bitmap_ }, \ + layout : { bitmap : (StgWord)bitmap_ }, \ SRT_INFO(type,srt_,srt_off_,srt_len_) \ } \ } @@ -386,7 +384,7 @@ typedef struct { { alt_7, alt_6, alt_5, alt_4, \ alt_3, alt_2, alt_1 }, \ i : { \ - layout : { bitmap : (StgWord32)bitmap_ }, \ + layout : { bitmap : (StgWord)bitmap_ }, \ SRT_INFO(type,srt_,srt_off_,srt_len_) \ } \ } @@ -400,7 +398,7 @@ typedef struct { { alt_8, alt_7, alt_6, alt_5, \ alt_4, alt_3, alt_2, alt_1 }, \ i : { \ - layout : { bitmap : (StgWord32)bitmap_ }, \ + layout : { bitmap : (StgWord)bitmap_ }, \ SRT_INFO(type,srt_,srt_off_,srt_len_) \ } \ } @@ -453,7 +451,7 @@ typedef struct { type, info_class, \ alt_1, alt_2) \ info_class INFO_TBL_CONST vec_info_2 info = { \ - i : { layout : { bitmap : (StgWord32)bitmap_ }, \ + i : { layout : { bitmap : (StgWord)bitmap_ }, \ SRT_INFO(type,srt_,srt_off_,srt_len_), \ INIT_ENTRY(NULL), \ }, \ @@ -465,7 +463,7 @@ typedef struct { alt_1, alt_2, alt_3 \ ) \ info_class INFO_TBL_CONST vec_info_3 info = { \ - i : { layout : { bitmap : (StgWord32)bitmap_ }, \ + i : { layout : { bitmap : (StgWord)bitmap_ }, \ SRT_INFO(type,srt_,srt_off_,srt_len_), \ INIT_ENTRY(NULL), \ }, \ @@ -477,7 +475,7 @@ typedef struct { alt_1, alt_2, alt_3, alt_4 \ ) \ info_class INFO_TBL_CONST vec_info_4 info = { \ - i : { layout : { bitmap : (StgWord32)bitmap_ }, \ + i : { layout : { bitmap : (StgWord)bitmap_ }, \ SRT_INFO(type,srt_,srt_off_,srt_len_), \ INIT_ENTRY(NULL), \ }, \ @@ -490,7 +488,7 @@ typedef struct { alt_5 \ ) \ info_class INFO_TBL_CONST vec_info_5 info = { \ - i : { layout : { bitmap : (StgWord32)bitmap_ }, \ + i : { layout : { bitmap : (StgWord)bitmap_ }, \ SRT_INFO(type,srt_,srt_off_,srt_len_), \ INIT_ENTRY(NULL), \ }, \ @@ -504,7 +502,7 @@ typedef struct { alt_5, alt_6 \ ) \ info_class INFO_TBL_CONST vec_info_6 info = { \ - i : { layout : { bitmap : (StgWord32)bitmap_ }, \ + i : { layout : { bitmap : (StgWord)bitmap_ }, \ SRT_INFO(type,srt_,srt_off_,srt_len_), \ INIT_ENTRY(NULL), \ }, \ @@ -518,7 +516,7 @@ typedef struct { alt_5, alt_6, alt_7 \ ) \ info_class INFO_TBL_CONST vec_info_7 info = { \ - i : { layout : { bitmap : (StgWord32)bitmap_ }, \ + i : { layout : { bitmap : (StgWord)bitmap_ }, \ SRT_INFO(type,srt_,srt_off_,srt_len_), \ INIT_ENTRY(NULL), \ }, \ @@ -532,7 +530,7 @@ typedef struct { alt_5, alt_6, alt_7, alt_8 \ ) \ info_class INFO_TBL_CONST vec_info_8 info = { \ - i : { layout : { bitmap : (StgWord32)bitmap_ }, \ + i : { layout : { bitmap : (StgWord)bitmap_ }, \ SRT_INFO(type,srt_,srt_off_,srt_len_), \ INIT_ENTRY(NULL), \ }, \ @@ -555,10 +553,9 @@ typedef vec_info_8 StgPolyInfoTable; type, info_class, entry_class \ ) \ info_class INFO_TBL_CONST vec_info_8 nm##_info = { \ - i : { layout : { bitmap : (StgWord32)bitmap_ }, \ + i : { layout : { bitmap : (StgWord)bitmap_ }, \ SRT_INFO(type,srt_,srt_off_,srt_len_), \ INIT_ENTRY(nm##_entry), \ - INIT_VECTOR \ }, \ vec : { \ (F_) nm##_0_entry, \ @@ -589,7 +586,7 @@ typedef vec_info_8 StgPolyInfoTable; (F_) nm##_0_entry \ }, \ i : { \ - layout : { bitmap : (StgWord32)bitmap_ }, \ + layout : { bitmap : (StgWord)bitmap_ }, \ SRT_INFO(type,srt_,srt_off_,srt_len_), \ INIT_ENTRY(nm##_entry) \ } \ @@ -600,8 +597,20 @@ typedef vec_info_8 StgPolyInfoTable; #define SRT(lbl) \ static const StgSRT lbl = { -#define BITMAP(lbl,size) \ - static const StgLargeBitmap lbl = { size, { +#define BITMAP(lbl,size,contents) \ + static const StgLargeBitmap lbl = { \ + (size*4+SIZEOF_VOID_P-1)/SIZEOF_VOID_P, { contents } }; + +#if SIZEOF_VOID_P == 8 +#define BITMAP_SWITCH64(small, large) small +#define BITMAP64(first, second) \ + (((StgWord32)(first)) | ((StgWord)(StgWord32)(second) << 32)) +#else +#define BITMAP_SWITCH64(small, large) large +#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 @@ -609,7 +618,7 @@ typedef vec_info_8 StgPolyInfoTable; to distinguish these kinds of references. (ToDo: fill in a more precise href.) */ -#ifdef HAVE_WIN32_DLL_SUPPORT /* mingw DietHEP doesn't seem to care either way */ +#ifdef ENABLE_WIN32_DLL_SUPPORT /* mingw DietHEP doesn't seem to care either way */ #define DLL_SRT_ENTRY(x) ((StgClosure*)(((char*)&DLL_IMPORT_DATA_VAR(x)) + 1)) #else #define DLL_SRT_ENTRY(x) no-can-do