[commit: ghc] wip/gc/nonmoving-nonconcurrent: rts/Scav: Expose scavenging functions (60bef7e)

git at git.haskell.org git at git.haskell.org
Thu Feb 21 15:12:27 UTC 2019


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/gc/nonmoving-nonconcurrent
Link       : http://ghc.haskell.org/trac/ghc/changeset/60bef7e45f217d76cc15dc7918738a11554d18c7/ghc

>---------------------------------------------------------------

commit 60bef7e45f217d76cc15dc7918738a11554d18c7
Author: Ömer Sinan Ağacan <omer at well-typed.com>
Date:   Tue Feb 5 11:46:25 2019 -0500

    rts/Scav: Expose scavenging functions
    
    To keep the non-moving collector nicely separated from the moving
    collector its scavenging phase will live in another file,
    `NonMovingScav.c`. However, it will need to use these functions so
    let's expose them.


>---------------------------------------------------------------

60bef7e45f217d76cc15dc7918738a11554d18c7
 rts/sm/Scav.c | 28 +++++++++++++++++-----------
 rts/sm/Scav.h | 14 ++++++++++++++
 2 files changed, 31 insertions(+), 11 deletions(-)

diff --git a/rts/sm/Scav.c b/rts/sm/Scav.c
index 36592af..711bfbb 100644
--- a/rts/sm/Scav.c
+++ b/rts/sm/Scav.c
@@ -63,8 +63,6 @@
 
 #include "sm/MarkWeak.h"
 
-static void scavenge_stack (StgPtr p, StgPtr stack_end);
-
 static void scavenge_large_bitmap (StgPtr p,
                                    StgLargeBitmap *large_bitmap,
                                    StgWord size );
@@ -76,6 +74,14 @@ static void scavenge_large_bitmap (StgPtr p,
 # define scavenge_block(a) scavenge_block1(a)
 # define scavenge_mutable_list(bd,g) scavenge_mutable_list1(bd,g)
 # define scavenge_capability_mut_lists(cap) scavenge_capability_mut_Lists1(cap)
+# define scavengeTSO(tso) scavengeTSO1(tso)
+# define scavenge_stack(p, stack_end) scavenge_stack1(p, stack_end)
+# define scavenge_fun_srt(info) scavenge_fun_srt1(info)
+# define scavenge_fun_srt(info) scavenge_fun_srt1(info)
+# define scavenge_thunk_srt(info) scavenge_thunk_srt1(info)
+# define scavenge_mut_arr_ptrs(info) scavenge_mut_arr_ptrs1(info)
+# define scavenge_PAP(pap) scavenge_PAP1(pap)
+# define scavenge_AP(ap) scavenge_AP1(ap)
 #endif
 
 static void do_evacuate(StgClosure **p, void *user STG_UNUSED)
@@ -87,7 +93,7 @@ static void do_evacuate(StgClosure **p, void *user STG_UNUSED)
    Scavenge a TSO.
    -------------------------------------------------------------------------- */
 
-static void
+void
 scavengeTSO (StgTSO *tso)
 {
     bool saved_eager;
@@ -198,7 +204,7 @@ scavenge_compact(StgCompactNFData *str)
    Mutable arrays of pointers
    -------------------------------------------------------------------------- */
 
-static StgPtr scavenge_mut_arr_ptrs (StgMutArrPtrs *a)
+StgPtr scavenge_mut_arr_ptrs (StgMutArrPtrs *a)
 {
     W_ m;
     bool any_failed;
@@ -348,14 +354,14 @@ scavenge_PAP_payload (StgClosure *fun, StgClosure **payload, StgWord size)
     return p;
 }
 
-STATIC_INLINE GNUC_ATTR_HOT StgPtr
+GNUC_ATTR_HOT StgPtr
 scavenge_PAP (StgPAP *pap)
 {
     evacuate(&pap->fun);
     return scavenge_PAP_payload (pap->fun, pap->payload, pap->n_args);
 }
 
-STATIC_INLINE StgPtr
+StgPtr
 scavenge_AP (StgAP *ap)
 {
     evacuate(&ap->fun);
@@ -366,7 +372,7 @@ scavenge_AP (StgAP *ap)
    Scavenge SRTs
    -------------------------------------------------------------------------- */
 
-STATIC_INLINE GNUC_ATTR_HOT void
+GNUC_ATTR_HOT void
 scavenge_thunk_srt(const StgInfoTable *info)
 {
     StgThunkInfoTable *thunk_info;
@@ -380,7 +386,7 @@ scavenge_thunk_srt(const StgInfoTable *info)
     }
 }
 
-STATIC_INLINE GNUC_ATTR_HOT void
+GNUC_ATTR_HOT void
 scavenge_fun_srt(const StgInfoTable *info)
 {
     StgFunInfoTable *fun_info;
@@ -1570,10 +1576,10 @@ static void
 scavenge_mutable_list(bdescr *bd, generation *gen)
 {
     StgPtr p, q;
-    uint32_t gen_no;
 
-    gen_no = gen->no;
+    uint32_t gen_no = gen->no;
     gct->evac_gen_no = gen_no;
+
     for (; bd != NULL; bd = bd->link) {
         for (q = bd->start; q < bd->free; q++) {
             p = (StgPtr)*q;
@@ -1793,7 +1799,7 @@ scavenge_large_bitmap( StgPtr p, StgLargeBitmap *large_bitmap, StgWord size )
    AP_STACK_UPDs, since these are just sections of copied stack.
    -------------------------------------------------------------------------- */
 
-static void
+void
 scavenge_stack(StgPtr p, StgPtr stack_end)
 {
   const StgRetInfoTable* info;
diff --git a/rts/sm/Scav.h b/rts/sm/Scav.h
index 6d265a7..ba434f0 100644
--- a/rts/sm/Scav.h
+++ b/rts/sm/Scav.h
@@ -17,10 +17,24 @@
 
 void    scavenge_loop (void);
 void    scavenge_capability_mut_lists (Capability *cap);
+void    scavengeTSO (StgTSO *tso);
+void    scavenge_stack (StgPtr p, StgPtr stack_end);
+void    scavenge_fun_srt (const StgInfoTable *info);
+void    scavenge_thunk_srt (const StgInfoTable *info);
+StgPtr  scavenge_mut_arr_ptrs (StgMutArrPtrs *a);
+StgPtr  scavenge_PAP (StgPAP *pap);
+StgPtr  scavenge_AP (StgAP *ap);
 
 #if defined(THREADED_RTS)
 void    scavenge_loop1 (void);
 void    scavenge_capability_mut_Lists1 (Capability *cap);
+void    scavengeTSO1 (StgTSO *tso);
+void    scavenge_stack1 (StgPtr p, StgPtr stack_end);
+void    scavenge_fun_srt1 (const StgInfoTable *info);
+void    scavenge_thunk_srt1 (const StgInfoTable *info);
+StgPtr  scavenge_mut_arr_ptrs1 (StgMutArrPtrs *a);
+StgPtr  scavenge_PAP1 (StgPAP *pap);
+StgPtr  scavenge_AP1 (StgAP *ap);
 #endif
 
 #include "EndPrivate.h"



More information about the ghc-commits mailing list