rts: Make SRTs a distinct closure type wip/rts-srt-closure-type
authorBen Gamari <bgamari.foss@gmail.com>
Mon, 21 Jan 2019 00:57:12 +0000 (19:57 -0500)
committerBen Gamari <ben@smart-cactus.org>
Mon, 21 Jan 2019 00:59:43 +0000 (19:59 -0500)
This will make it easier to count closure traversals during scavenging.

Previously Differential Revision https://phabricator.haskell.org/D5098

20 files changed:
includes/rts/storage/ClosureTypes.h
libraries/Cabal
libraries/binary
libraries/bytestring
libraries/containers
libraries/deepseq
libraries/directory
libraries/hpc
libraries/stm
libraries/text
libraries/time
libraries/unix
nofib
rts/ClosureFlags.c
rts/Printer.c
rts/StgMiscClosures.cmm
rts/sm/Evac.c
rts/sm/Scav.c
utils/haddock
utils/hsc2hs

index 85dc1a0..5319e9c 100644 (file)
@@ -83,4 +83,5 @@
 #define SMALL_MUT_ARR_PTRS_FROZEN_DIRTY 61
 #define SMALL_MUT_ARR_PTRS_FROZEN_CLEAN 62
 #define COMPACT_NFDATA                63
-#define N_CLOSURE_TYPES               64
+#define SRT                           64
+#define N_CLOSURE_TYPES               65
index 98fcb3a..fe10982 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 98fcb3a964a4deef67920020a4a02d4d8552cc19
+Subproject commit fe10982db1f2fa7d828fc5f8ddaa5beedceaddec
index fb461cf..38adf7c 160000 (submodule)
@@ -1 +1 @@
-Subproject commit fb461cf048460813a7fac8e040c1004a0d123e42
+Subproject commit 38adf7ce1ad6a497fba61de500c3f35b186303a9
index 847563a..ce3c6a0 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 847563a2e5ce84714688429c4fee8df5c8568cb0
+Subproject commit ce3c6a01cd9e2438358108e3e4b515304b5ce5a6
index 03dcb28..e5b3bba 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 03dcb287c96613ceb1f64d5d5a82f7b94b879268
+Subproject commit e5b3bbaeb79cbf3a2c99bd14257d4199cc651b73
index 4f03181..fe94780 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 4f031810fc0eaf5ba12d805ff8df7f15e561e407
+Subproject commit fe94780b629b27969c5e8965e6e6ccde564ece61
index 19d6dc0..e9debc1 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 19d6dc0d33366a8920bf8acc7a0fd3ef533d39c3
+Subproject commit e9debc1d4a9c4b608a32f60bae173ed10f89fdce
index 2678098..85e04ed 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 26780988735bdb8fdbeffb59c4a8d585b9e46c3e
+Subproject commit 85e04edd6e29de549301cf10d2c725cbf29b2098
index 5f4d7c6..4a1deb9 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 5f4d7c6d07a760d935c9d96e62999f1ad38a5e43
+Subproject commit 4a1deb98fc95e55d8a6762a7dfec1a7dfa8b49b2
index 69d625b..a02c2da 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 69d625b9caa34fd8b384a4599ee98f5f53f20fbb
+Subproject commit a02c2dafafa425bd5f36c8629e98b98daf1cfa1e
index 9e96c26..1fcaa07 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 9e96c26132fef01a3113c8b152b1be96c0eccd86
+Subproject commit 1fcaa07e10d7966356373ed0e946eb078fcdd6e6
index dbada98..f4f500d 160000 (submodule)
@@ -1 +1 @@
-Subproject commit dbada9890c1d58111af7d4ebb2a67d38a3a6a872
+Subproject commit f4f500d53b4c73e542a377a5c675309dbbe5774d
diff --git a/nofib b/nofib
index f87d446..a3b0f2b 160000 (submodule)
--- a/nofib
+++ b/nofib
@@ -1 +1 @@
-Subproject commit f87d446b4e361cc82f219cf78917db9681af69b3
+Subproject commit a3b0f2b2cff8babbb85cbbe1e7515905ffb444a8
index f8dba8f..45d7138 100644 (file)
@@ -85,8 +85,9 @@ StgWord16 closure_flags[] = {
  [SMALL_MUT_ARR_PTRS_FROZEN_DIRTY] =  (_HNF|     _NS|     _MUT|_UPT           ),
  [SMALL_MUT_ARR_PTRS_FROZEN_CLEAN] =  (_HNF|     _NS|          _UPT           ),
  [COMPACT_NFDATA]       =  (_HNF|     _NS                              ),
+ [SRT]                  =  (_HNF|     _NS                         ),
 };
 
-#if N_CLOSURE_TYPES != 64
+#if N_CLOSURE_TYPES != 65
 #error Closure types changed: update ClosureFlags.c!
 #endif
index 291f529..4787290 100644 (file)
@@ -950,10 +950,11 @@ const char *closure_type_names[] = {
  [SMALL_MUT_ARR_PTRS_DIRTY] = "SMALL_MUT_ARR_PTRS_DIRTY",
  [SMALL_MUT_ARR_PTRS_FROZEN_DIRTY] = "SMALL_MUT_ARR_PTRS_FROZEN_DIRTY",
  [SMALL_MUT_ARR_PTRS_FROZEN_CLEAN] = "SMALL_MUT_ARR_PTRS_FROZEN_CLEAN",
- [COMPACT_NFDATA]        = "COMPACT_NFDATA"
+ [COMPACT_NFDATA]        = "COMPACT_NFDATA",
+ [SRT]                   = "SRT",
 };
 
-#if N_CLOSURE_TYPES != 64
+#if N_CLOSURE_TYPES != 65
 #error Closure types changed: update Printer.c!
 #endif
 
index fdd9f15..35e9a36 100644 (file)
@@ -512,52 +512,52 @@ CLOSURE(stg_NO_TREC_closure,stg_NO_TREC);
    See Note [SRTs] in compiler/cmm/CmmBuildInfoTable.hs
    ------------------------------------------------------------------------- */
 
-INFO_TABLE_CONSTR(stg_SRT_1, 1, 0, 0, CONSTR_1_0, "SRT_1", "SRT_1")
+INFO_TABLE_CONSTR(stg_SRT_1, 1, 0, 0, SRT, "SRT_1", "SRT_1")
 { foreign "C" barf("SRT_1 object (%p) entered!", R1) never returns; }
 
-INFO_TABLE_CONSTR(stg_SRT_2, 2, 0, 0, CONSTR_2_0, "SRT_2", "SRT_2")
+INFO_TABLE_CONSTR(stg_SRT_2, 2, 0, 0, SRT, "SRT_2", "SRT_2")
 { foreign "C" barf("SRT_2 object (%p) entered!", R1) never returns; }
 
-INFO_TABLE_CONSTR(stg_SRT_3, 3, 0, 0, CONSTR, "SRT_3", "SRT_3")
+INFO_TABLE_CONSTR(stg_SRT_3, 3, 0, 0, SRT, "SRT_3", "SRT_3")
 { foreign "C" barf("SRT_3 object (%p) entered!", R1) never returns; }
 
-INFO_TABLE_CONSTR(stg_SRT_4, 4, 0, 0, CONSTR, "SRT_4", "SRT_4")
+INFO_TABLE_CONSTR(stg_SRT_4, 4, 0, 0, SRT, "SRT_4", "SRT_4")
 { foreign "C" barf("SRT_4 object (%p) entered!", R1) never returns; }
 
-INFO_TABLE_CONSTR(stg_SRT_5, 5, 0, 0, CONSTR, "SRT_5", "SRT_5")
+INFO_TABLE_CONSTR(stg_SRT_5, 5, 0, 0, SRT, "SRT_5", "SRT_5")
 { foreign "C" barf("SRT_5 object (%p) entered!", R1) never returns; }
 
-INFO_TABLE_CONSTR(stg_SRT_6, 6, 0, 0, CONSTR, "SRT_6", "SRT_6")
+INFO_TABLE_CONSTR(stg_SRT_6, 6, 0, 0, SRT, "SRT_6", "SRT_6")
 { foreign "C" barf("SRT_6 object (%p) entered!", R1) never returns; }
 
-INFO_TABLE_CONSTR(stg_SRT_7, 7, 0, 0, CONSTR, "SRT_7", "SRT_7")
+INFO_TABLE_CONSTR(stg_SRT_7, 7, 0, 0, SRT, "SRT_7", "SRT_7")
 { foreign "C" barf("SRT_7 object (%p) entered!", R1) never returns; }
 
-INFO_TABLE_CONSTR(stg_SRT_8, 8, 0, 0, CONSTR, "SRT_8", "SRT_8")
+INFO_TABLE_CONSTR(stg_SRT_8, 8, 0, 0, SRT, "SRT_8", "SRT_8")
 { foreign "C" barf("SRT_8 object (%p) entered!", R1) never returns; }
 
-INFO_TABLE_CONSTR(stg_SRT_9, 9, 0, 0, CONSTR, "SRT_9", "SRT_9")
+INFO_TABLE_CONSTR(stg_SRT_9, 9, 0, 0, SRT, "SRT_9", "SRT_9")
 { foreign "C" barf("SRT_9 object (%p) entered!", R1) never returns; }
 
-INFO_TABLE_CONSTR(stg_SRT_10, 10, 0, 0, CONSTR, "SRT_10", "SRT_10")
+INFO_TABLE_CONSTR(stg_SRT_10, 10, 0, 0, SRT, "SRT_10", "SRT_10")
 { foreign "C" barf("SRT_10 object (%p) entered!", R1) never returns; }
 
-INFO_TABLE_CONSTR(stg_SRT_11, 11, 0, 0, CONSTR, "SRT_11", "SRT_11")
+INFO_TABLE_CONSTR(stg_SRT_11, 11, 0, 0, SRT, "SRT_11", "SRT_11")
 { foreign "C" barf("SRT_11 object (%p) entered!", R1) never returns; }
 
-INFO_TABLE_CONSTR(stg_SRT_12, 12, 0, 0, CONSTR, "SRT_12", "SRT_12")
+INFO_TABLE_CONSTR(stg_SRT_12, 12, 0, 0, SRT, "SRT_12", "SRT_12")
 { foreign "C" barf("SRT_12 object (%p) entered!", R1) never returns; }
 
-INFO_TABLE_CONSTR(stg_SRT_13, 13, 0, 0, CONSTR, "SRT_13", "SRT_13")
+INFO_TABLE_CONSTR(stg_SRT_13, 13, 0, 0, SRT, "SRT_13", "SRT_13")
 { foreign "C" barf("SRT_13 object (%p) entered!", R1) never returns; }
 
-INFO_TABLE_CONSTR(stg_SRT_14, 14, 0, 0, CONSTR, "SRT_14", "SRT_14")
+INFO_TABLE_CONSTR(stg_SRT_14, 14, 0, 0, SRT, "SRT_14", "SRT_14")
 { foreign "C" barf("SRT_14 object (%p) entered!", R1) never returns; }
 
-INFO_TABLE_CONSTR(stg_SRT_15, 15, 0, 0, CONSTR, "SRT_15", "SRT_15")
+INFO_TABLE_CONSTR(stg_SRT_15, 15, 0, 0, SRT, "SRT_15", "SRT_15")
 { foreign "C" barf("SRT_15 object (%p) entered!", R1) never returns; }
 
-INFO_TABLE_CONSTR(stg_SRT_16, 16, 0, 0, CONSTR, "SRT_16", "SRT_16")
+INFO_TABLE_CONSTR(stg_SRT_16, 16, 0, 0, SRT, "SRT_16", "SRT_16")
 { foreign "C" barf("SRT_16 object (%p) entered!", R1) never returns; }
 
 /* ---------------------------------------------------------------------------   Messages
index 2890319..20ea2f5 100644 (file)
@@ -541,6 +541,10 @@ loop:
           evacuate_static_object(IND_STATIC_LINK((StgClosure *)q), q);
           return;
 
+      case SRT:
+          evacuate_static_object(STATIC_LINK(info,(StgClosure *)q), q);
+          return;
+
       case CONSTR:
       case CONSTR_1_0:
       case CONSTR_2_0:
index 8bc7029..e96373a 100644 (file)
@@ -1751,6 +1751,7 @@ scavenge_static(void)
     case CONSTR_2_0:
     case CONSTR_1_1:
     case CONSTR_0_2:
+    case SRT:
       {
         StgPtr q, next;
 
index 21e4f3f..9ef12f3 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 21e4f3fa6f73a9b25f3deed80da0e56024238ea5
+Subproject commit 9ef12f3c2f0ef2948e6f4bd38fdfa002c416ab09
index a816333..6b6938d 160000 (submodule)
@@ -1 +1 @@
-Subproject commit a816333ae67c54b98cce4ed22621242714967b3e
+Subproject commit 6b6938db11a33904bb6ba90d70d89df4b72a7f90