summaryrefslogtreecommitdiff
path: root/compiler/codeGen/StgCmm.hs
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2011-08-24 10:38:58 +0100
committerSimon Marlow <marlowsd@gmail.com>2011-08-25 11:12:33 +0100
commit3a179c20d180ef8302dfccd3470b668c2b2cdeef (patch)
treec0f5baef87d0108ae295a538ec17da3e731684dc /compiler/codeGen/StgCmm.hs
parent4a86a0bff7e8fb3e87708f29adf87bf566632861 (diff)
downloadhaskell-3a179c20d180ef8302dfccd3470b668c2b2cdeef.tar.gz
Refactoring: reduce usage of mkConInfo, with a view to killing it
Diffstat (limited to 'compiler/codeGen/StgCmm.hs')
-rw-r--r--compiler/codeGen/StgCmm.hs25
1 files changed, 11 insertions, 14 deletions
diff --git a/compiler/codeGen/StgCmm.hs b/compiler/codeGen/StgCmm.hs
index c4ba409734..f88541a023 100644
--- a/compiler/codeGen/StgCmm.hs
+++ b/compiler/codeGen/StgCmm.hs
@@ -245,21 +245,18 @@ cgDataCon :: DataCon -> FCode ()
-- the static closure, for a constructor.
cgDataCon data_con
= do { let
- -- To allow the debuggers, interpreters, etc to cope with
- -- static data structures (ie those built at compile
- -- time), we take care that info-table contains the
- -- information we need.
- static_cl_info = mkConInfo True no_cafs data_con tot_wds ptr_wds
- dyn_cl_info = mkConInfo False NoCafRefs data_con tot_wds ptr_wds
- no_cafs = pprPanic "cgDataCon: CAF field should not be reqd" (ppr data_con)
-
- (tot_wds, -- #ptr_wds + #nonptr_wds
+ (tot_wds, -- #ptr_wds + #nonptr_wds
ptr_wds, -- #ptr_wds
arg_things) = mkVirtConstrOffsets arg_reps
- emit_info cl_info ticky_code
- = emitClosureAndInfoTable cl_info NativeDirectCall []
- $ mk_code ticky_code
+ nonptr_wds = tot_wds - ptr_wds
+
+ sta_info_tbl = mkDataConInfoTable data_con True ptr_wds nonptr_wds
+ dyn_info_tbl = mkDataConInfoTable data_con False ptr_wds nonptr_wds
+
+ emit_info info_tbl ticky_code
+ = emitClosureAndInfoTable info_tbl NativeDirectCall []
+ $ mk_code ticky_code
mk_code ticky_code
= -- NB: We don't set CC when entering data (WDP 94/06)
@@ -275,10 +272,10 @@ cgDataCon data_con
-- Dynamic closure code for non-nullary constructors only
; whenC (not (isNullaryRepDataCon data_con))
- (emit_info dyn_cl_info tickyEnterDynCon)
+ (emit_info dyn_info_tbl tickyEnterDynCon)
-- Dynamic-Closure first, to reduce forward references
- ; emit_info static_cl_info tickyEnterStaticCon }
+ ; emit_info sta_info_tbl tickyEnterStaticCon }
---------------------------------------------------------------