diff options
author | Daniel Gröber <dxld@darkboxed.org> | 2019-06-14 18:01:59 +0200 |
---|---|---|
committer | Daniel Gröber <dxld@darkboxed.org> | 2019-09-22 15:18:10 +0200 |
commit | 2f2f6dd5b708eae4888782ca3eb555152b64ee90 (patch) | |
tree | 31b7e16d658dec5c706d6dd74c101d99b987f1a2 /rts/RetainerProfile.h | |
parent | f083358b177fad4d5f0325d3cc099eeed64e7f54 (diff) | |
download | haskell-2f2f6dd5b708eae4888782ca3eb555152b64ee90.tar.gz |
rts: Generalise profiling heap traversal flip bit handling
This commit starts renaming some flip bit related functions for the
generalised heap traversal code and adds provitions for sharing the
per-closure profiling header field currently used exclusively for retainer
profiling with other heap traversal profiling modes.
Diffstat (limited to 'rts/RetainerProfile.h')
-rw-r--r-- | rts/RetainerProfile.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/rts/RetainerProfile.h b/rts/RetainerProfile.h index bc11cc7e80..3eb27a7346 100644 --- a/rts/RetainerProfile.h +++ b/rts/RetainerProfile.h @@ -20,21 +20,20 @@ void endRetainerProfiling ( void ); void retainerProfile ( void ); void resetStaticObjectForRetainerProfiling( StgClosure *static_objects ); -// flip is either 1 or 0, changed at the beginning of retainerProfile() -// It is used to tell whether a retainer set has been touched so far -// during this pass. +/* See Note [Profiling heap traversal visited bit]. */ extern StgWord flip; // extract the retainer set field from c -#define RSET(c) ((c)->header.prof.hp.rs) +#define RSET(c) ((c)->header.prof.hp.trav.rs) -#define isRetainerSetFieldValid(c) \ - ((((StgWord)(c)->header.prof.hp.rs & 1) ^ flip) == 0) + +#define isTravDataValid(c) \ + ((((StgWord)(c)->header.prof.hp.trav.lsb & 1) ^ flip) == 0) static inline RetainerSet * retainerSetOf( const StgClosure *c ) { - ASSERT( isRetainerSetFieldValid(c) ); + ASSERT( isTravDataValid(c) ); // StgWord has the same size as pointers, so the following type // casting is okay. return (RetainerSet *)((StgWord)RSET(c) ^ flip); |