summaryrefslogtreecommitdiff
path: root/rts
diff options
context:
space:
mode:
Diffstat (limited to 'rts')
-rw-r--r--rts/StgMiscClosures.cmm9
-rw-r--r--rts/sm/Evac.c12
2 files changed, 18 insertions, 3 deletions
diff --git a/rts/StgMiscClosures.cmm b/rts/StgMiscClosures.cmm
index 95b22a9211..5e74d3f55f 100644
--- a/rts/StgMiscClosures.cmm
+++ b/rts/StgMiscClosures.cmm
@@ -564,10 +564,12 @@ CLOSURE(stg_dummy_ret_closure,stg_dummy_ret);
#if defined(__PIC__) && defined(mingw32_TARGET_OS)
/*
- * When sticking the RTS in a DLL, we delay populating the
+ * When sticking the RTS in a Windows DLL, we delay populating the
* Charlike and Intlike tables until load-time, which is only
* when we've got the real addresses to the C# and I# closures.
- *
+ *
+ * -- this is currently broken BL 2009/11/14.
+ * we don't rewrite to static closures at all with Windows DLLs.
*/
#warning Is this correct? _imp is a pointer!
#define Char_hash_static_info _imp__ghczmprim_GHCziTypes_Czh_static_info
@@ -587,6 +589,7 @@ CLOSURE(stg_dummy_ret_closure,stg_dummy_ret);
/* end the name with _closure, to convince the mangler this is a closure */
+#if !(defined(__PIC__) && defined(mingw32_HOST_OS))
section "data" {
stg_CHARLIKE_closure:
CHARLIKE_HDR(0)
@@ -883,3 +886,5 @@ section "data" {
INTLIKE_HDR(15)
INTLIKE_HDR(16) /* MAX_INTLIKE == 16 */
}
+
+#endif // !(defined(__PIC__) && defined(mingw32_HOST_OS))
diff --git a/rts/sm/Evac.c b/rts/sm/Evac.c
index 379fbbaffd..3212ce5852 100644
--- a/rts/sm/Evac.c
+++ b/rts/sm/Evac.c
@@ -549,8 +549,17 @@ loop:
copy(p,info,q,sizeW_fromITBL(INFO_PTR_TO_STRUCT(info)),stp);
return;
+ // For ints and chars of low value, save space by replacing references to
+ // these with closures with references to common, shared ones in the RTS.
+ //
+ // * Except when compiling into Windows DLLs which don't support cross-package
+ // data references very well.
+ //
case CONSTR_0_1:
- {
+ {
+#if defined(__PIC__) && defined(mingw32_HOST_OS)
+ copy_tag_nolock(p,info,q,sizeofW(StgHeader)+1,stp,tag);
+#else
StgWord w = (StgWord)q->payload[0];
if (info == Czh_con_info &&
// unsigned, so always true: (StgChar)w >= MIN_CHARLIKE &&
@@ -568,6 +577,7 @@ loop:
else {
copy_tag_nolock(p,info,q,sizeofW(StgHeader)+1,stp,tag);
}
+#endif
return;
}