summaryrefslogtreecommitdiff
path: root/includes/mkDerivedConstants.c
diff options
context:
space:
mode:
authordias@eecs.harvard.edu <unknown>2008-08-14 12:40:27 +0000
committerdias@eecs.harvard.edu <unknown>2008-08-14 12:40:27 +0000
commit176fa33f17dd78355cc572e006d2ab26898e2c69 (patch)
tree54f951a515eac57626f8f15d57f7bc75f1096a7a /includes/mkDerivedConstants.c
parente06951a75a1f519e8f015880c363a8dedc08ff9c (diff)
downloadhaskell-176fa33f17dd78355cc572e006d2ab26898e2c69.tar.gz
Merging in the new codegen branch
This merge does not turn on the new codegen (which only compiles a select few programs at this point), but it does introduce some changes to the old code generator. The high bits: 1. The Rep Swamp patch is finally here. The highlight is that the representation of types at the machine level has changed. Consequently, this patch contains updates across several back ends. 2. The new Stg -> Cmm path is here, although it appears to have a fair number of bugs lurking. 3. Many improvements along the CmmCPSZ path, including: o stack layout o some code for infotables, half of which is right and half wrong o proc-point splitting
Diffstat (limited to 'includes/mkDerivedConstants.c')
-rw-r--r--includes/mkDerivedConstants.c35
1 files changed, 25 insertions, 10 deletions
diff --git a/includes/mkDerivedConstants.c b/includes/mkDerivedConstants.c
index 798c6e6ab0..116b2e9971 100644
--- a/includes/mkDerivedConstants.c
+++ b/includes/mkDerivedConstants.c
@@ -57,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) \
@@ -136,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));
@@ -310,23 +325,23 @@ 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);