[commit: ghc] wip/T10613: Evac: Do not evaluate selector thunks pointing to counting indirections (2e0ccaf)

git at git.haskell.org git at git.haskell.org
Wed Mar 23 13:47:48 UTC 2016


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

On branch  : wip/T10613
Link       : http://ghc.haskell.org/trac/ghc/changeset/2e0ccafe3d03758f506c7f1738c6bdbd71f62f22/ghc

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

commit 2e0ccafe3d03758f506c7f1738c6bdbd71f62f22
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Wed Mar 23 13:50:00 2016 +0100

    Evac: Do not evaluate selector thunks pointing to counting indirections


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

2e0ccafe3d03758f506c7f1738c6bdbd71f62f22
 rts/sm/Evac.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/rts/sm/Evac.c b/rts/sm/Evac.c
index 3b4314b..9369543 100644
--- a/rts/sm/Evac.c
+++ b/rts/sm/Evac.c
@@ -998,12 +998,17 @@ selector_loop:
           }
 
       case IND:
-      case COUNTING_IND:
       case IND_STATIC:
           // Again, we might need to untag a constructor.
           selectee = UNTAG_CLOSURE( ((StgInd *)selectee)->indirectee );
           goto selector_loop;
 
+      case COUNTING_IND:
+          // do not short cut a COUNTING_IND, as we would miss a the count
+	  // Can we simply tick the counter here? Not really: If this selector
+	  // thunk is not going to be used, we counted more than we wanted!
+          goto bale_out;
+
       case BLACKHOLE:
       {
           StgClosure *r;



More information about the ghc-commits mailing list