summaryrefslogtreecommitdiff
path: root/compiler/codeGen/StgCmmTicky.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/codeGen/StgCmmTicky.hs')
-rw-r--r--compiler/codeGen/StgCmmTicky.hs25
1 files changed, 17 insertions, 8 deletions
diff --git a/compiler/codeGen/StgCmmTicky.hs b/compiler/codeGen/StgCmmTicky.hs
index 004c940d54..6ac0fe3c5e 100644
--- a/compiler/codeGen/StgCmmTicky.hs
+++ b/compiler/codeGen/StgCmmTicky.hs
@@ -133,7 +133,7 @@ import TyCon
import Data.Maybe
import qualified Data.Char
-import Control.Monad ( when )
+import Control.Monad ( unless, when )
-----------------------------------------------------------------------------
--
@@ -238,13 +238,22 @@ tickyEnterDynCon = ifTicky $ bumpTickyCounter (fsLit "ENT_DYN_CON_ctr")
tickyEnterStaticCon = ifTicky $ bumpTickyCounter (fsLit "ENT_STATIC_CON_ctr")
tickyEnterViaNode = ifTicky $ bumpTickyCounter (fsLit "ENT_VIA_NODE_ctr")
-tickyEnterThunk :: FCode ()
-tickyEnterThunk = ifTicky $ do
- bumpTickyCounter (fsLit "ENT_DYN_THK_ctr")
- ifTickyDynThunk $ do
- ticky_ctr_lbl <- getTickyCtrLabel
- registerTickyCtrAtEntryDyn ticky_ctr_lbl
- bumpTickyEntryCount ticky_ctr_lbl
+tickyEnterThunk :: ClosureInfo -> FCode ()
+tickyEnterThunk cl_info
+ = ifTicky $ do
+ { bumpTickyCounter ctr
+ ; unless static $ do
+ ticky_ctr_lbl <- getTickyCtrLabel
+ registerTickyCtrAtEntryDyn ticky_ctr_lbl
+ bumpTickyEntryCount ticky_ctr_lbl }
+ where
+ updatable = closureSingleEntry cl_info
+ static = isStaticClosure cl_info
+
+ ctr | static = if updatable then fsLit "ENT_STATIC_THK_SINGLE_ctr"
+ else fsLit "ENT_STATIC_THK_MANY_ctr"
+ | otherwise = if updatable then fsLit "ENT_DYN_THK_SINGLE_ctr"
+ else fsLit "ENT_DYN_THK_MANY_ctr"
tickyEnterStdThunk :: FCode ()
tickyEnterStdThunk = tickyEnterThunk