X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=includes%2FmkDerivedConstants.c;h=116b2e997185a8ded9f1809dcca6363df75bc35c;hb=960a5edb6ac87c7d85e36f4b70be8da0175819f7;hp=689851e4e30b4ba15c5f333b3ee9064463d01f1e;hpb=081e9e53205935280f1800f113760a8a72498a6f;p=ghc-hetmet.git diff --git a/includes/mkDerivedConstants.c b/includes/mkDerivedConstants.c index 689851e..116b2e9 100644 --- a/includes/mkDerivedConstants.c +++ b/includes/mkDerivedConstants.c @@ -23,6 +23,7 @@ #include "Rts.h" #include "RtsFlags.h" #include "Storage.h" +#include "Stable.h" #include "OSThreads.h" #include "Capability.h" @@ -30,14 +31,21 @@ #define str(a,b) #a "_" #b -#define OFFSET(s_type, field) ((unsigned int)&(((s_type*)0)->field)) +#define OFFSET(s_type, field) ((size_t)&(((s_type*)0)->field)) + +#ifdef mingw32_HOST_OS +#define SIZET_FMT "d" +#else +#define SIZET_FMT "zd" +#endif #if defined(GEN_HASKELL) -#define def_offset(str, offset) \ - printf("oFFSET_" str " = %d::Int\n", offset); +#define def_offset(str, offset) \ + printf("oFFSET_" str " :: Int\n"); \ + printf("oFFSET_" str " = %" SIZET_FMT "\n", offset); #else #define def_offset(str, offset) \ - printf("#define OFFSET_" str " %d\n", offset); + printf("#define OFFSET_" str " %" SIZET_FMT "\n", offset); #endif #if defined(GEN_HASKELL) @@ -49,10 +57,19 @@ #if defined(GEN_HASKELL) #define field_type_(str, s_type, field) /* nothing */ +#define field_type_gcptr_(str, s_type, field) /* nothing */ #else +/* Defining REP_x to be b32 etc + These are both the C-- types used in a load + e.g. b32[addr] + and the names of the CmmTypes in the compiler + b32 :: CmmType +*/ #define field_type_(str, s_type, field) \ - printf("#define REP_" str " I"); \ + printf("#define REP_" str " b"); \ printf("%d\n", sizeof (__typeof__(((((s_type*)0)->field)))) * 8); +#define field_type_gcptr_(str, s_type, field) \ + printf("#define REP_" str " gcptr\n"); #endif #define field_type(s_type, field) \ @@ -80,8 +97,9 @@ struct_field_macro(str) #if defined(GEN_HASKELL) -#define def_size(str, size) \ - printf("sIZEOF_" str " = %d::Int\n", size); +#define def_size(str, size) \ + printf("sIZEOF_" str " :: Int\n"); \ + printf("sIZEOF_" str " = %d\n", size); #else #define def_size(str, size) \ printf("#define SIZEOF_" str " %d\n", size); @@ -127,17 +145,23 @@ closure_payload_macro(str(s_type,field)); /* Byte offset and MachRep for a closure field, minus the header */ +#define closure_field_(str, s_type, field) \ + closure_field_offset_(str,s_type,field) \ + field_type_(str, s_type, field); \ + closure_field_macro(str) + #define closure_field(s_type, field) \ - closure_field_offset(s_type,field) \ - field_type(s_type, field); \ - closure_field_macro(str(s_type,field)) + closure_field_(str(s_type,field),s_type,field) /* Byte offset and MachRep for a closure field, minus the header */ -#define closure_field_(str, s_type, field) \ +#define closure_field_gcptr_(str, s_type, field) \ closure_field_offset_(str,s_type,field) \ - field_type_(str, s_type, field); \ + field_type_gcptr_(str, s_type, field); \ closure_field_macro(str) +#define closure_field_gcptr(s_type, field) \ + closure_field_gcptr_(str(s_type,field),s_type,field) + /* Byte offset for a TSO field, minus the header and variable prof bit. */ #define tso_payload_offset(s_type, field) \ def_offset(str(s_type,field), OFFSET(s_type,field) - sizeof(StgHeader) - sizeof(StgTSOProfInfo)); @@ -178,13 +202,6 @@ main(int argc, char *argv[]) printf("#define PROF_HDR_SIZE %d\n", sizeofW(StgProfHeader)); printf("#define GRAN_HDR_SIZE %d\n", sizeofW(StgGranHeader)); - printf("#define STD_ITBL_SIZE %d\n", sizeofW(StgInfoTable)); - printf("#define RET_ITBL_SIZE %d\n", sizeofW(StgRetInfoTable) - sizeofW(StgInfoTable)); - printf("#define PROF_ITBL_SIZE %d\n", sizeofW(StgProfInfo)); - - printf("#define GRAN_ITBL_SIZE %d\n", 0); - printf("#define TICKY_ITBL_SIZE %d\n", 0); - printf("#define BLOCK_SIZE %d\n", BLOCK_SIZE); printf("#define MBLOCK_SIZE %d\n", MBLOCK_SIZE); @@ -224,11 +241,14 @@ main(int argc, char *argv[]) field_offset(StgRegTable, rmp_result1); field_offset(StgRegTable, rmp_result2); + def_offset("stgEagerBlackholeInfo", FUN_OFFSET(stgEagerBlackholeInfo)); def_offset("stgGCEnter1", FUN_OFFSET(stgGCEnter1)); def_offset("stgGCFun", FUN_OFFSET(stgGCFun)); field_offset(Capability, r); field_offset(Capability, lock); + struct_field(Capability, mut_lists); + struct_field(Capability, context_switch); struct_field(bdescr, start); struct_field(bdescr, free); @@ -259,7 +279,8 @@ main(int argc, char *argv[]) struct_field(StgEntCounter, allocs); struct_field(StgEntCounter, registeredp); struct_field(StgEntCounter, link); - + struct_field(StgEntCounter, entry_count); + closure_size(StgUpdateFrame); closure_size(StgCatchFrame); closure_size(StgStopFrame); @@ -271,7 +292,7 @@ main(int argc, char *argv[]) closure_field(StgArrWords, words); closure_payload(StgArrWords, payload); - closure_field(StgTSO, link); + closure_field(StgTSO, _link); closure_field(StgTSO, global_link); closure_field(StgTSO, what_next); closure_field(StgTSO, why_blocked); @@ -304,38 +325,51 @@ main(int argc, char *argv[]) closure_size(StgPAP); closure_field(StgPAP, n_args); - closure_field(StgPAP, fun); + closure_field_gcptr(StgPAP, fun); closure_field(StgPAP, arity); closure_payload(StgPAP, payload); thunk_size(StgAP); closure_field(StgAP, n_args); - closure_field(StgAP, fun); + closure_field_gcptr(StgAP, fun); closure_payload(StgAP, payload); thunk_size(StgAP_STACK); closure_field(StgAP_STACK, size); - closure_field(StgAP_STACK, fun); + closure_field_gcptr(StgAP_STACK, fun); closure_payload(StgAP_STACK, payload); thunk_size(StgSelector); - closure_field(StgInd, indirectee); + closure_field_gcptr(StgInd, indirectee); closure_size(StgMutVar); closure_field(StgMutVar, var); closure_size(StgAtomicallyFrame); closure_field(StgAtomicallyFrame, code); + closure_field(StgAtomicallyFrame, next_invariant_to_check); + + closure_field(StgInvariantCheckQueue, invariant); + closure_field(StgInvariantCheckQueue, my_execution); + closure_field(StgInvariantCheckQueue, next_queue_entry); + + closure_field(StgAtomicInvariant, code); closure_size(StgCatchSTMFrame); closure_field(StgCatchSTMFrame, handler); + closure_field(StgCatchSTMFrame, code); closure_size(StgCatchRetryFrame); closure_field(StgCatchRetryFrame, running_alt_code); closure_field(StgCatchRetryFrame, first_code); closure_field(StgCatchRetryFrame, alt_code); - closure_field(StgCatchRetryFrame, first_code_trec); + + closure_field(StgTVarWatchQueue, closure); + closure_field(StgTVarWatchQueue, next_queue_entry); + closure_field(StgTVarWatchQueue, prev_queue_entry); + + closure_field(StgTVar, current_value); closure_size(StgWeak); closure_field(StgWeak,link); @@ -355,7 +389,6 @@ main(int argc, char *argv[]) closure_field(StgBCO, instrs); closure_field(StgBCO, literals); closure_field(StgBCO, ptrs); - closure_field(StgBCO, itbls); closure_field(StgBCO, arity); closure_field(StgBCO, size); closure_payload(StgBCO, bitmap); @@ -373,6 +406,8 @@ main(int argc, char *argv[]) RTS_FLAGS, DebugFlags.weak); struct_field_("RtsFlags_GcFlags_initialStkSize", RTS_FLAGS, GcFlags.initialStkSize); + struct_field_("RtsFlags_MiscFlags_tickInterval", + RTS_FLAGS, MiscFlags.tickInterval); struct_size(StgFunInfoExtraFwd); struct_field(StgFunInfoExtraFwd, slow_apply);