summaryrefslogtreecommitdiff
path: root/rts/Sparks.c
diff options
context:
space:
mode:
authorDuncan Coutts <duncan@well-typed.com>2011-06-01 17:16:29 +0100
committerDuncan Coutts <duncan@well-typed.com>2011-07-18 16:31:13 +0100
commite0b98b42847dea19aff24df2faa354c9d414fc87 (patch)
treee354b2c867ffe1d5e1e71b999c25139d5312661f /rts/Sparks.c
parent81eddb4c58c6d4171a46c727574112e2083c4878 (diff)
downloadhaskell-e0b98b42847dea19aff24df2faa354c9d414fc87.tar.gz
Improve the newSpark dud test by using the pointer tag bits
newSpark() checks if the spark is a dud, and if so does not add it to the spark pool. Previously, newSpark would discard the pointer tag bits and just check closure_SHOULD_SPARK(p). We can take advantage of the tag bits which can tell us if the pointer points to a value. If it is, it's a dud spark and we don't need to add it to the spark pool.
Diffstat (limited to 'rts/Sparks.c')
-rw-r--r--rts/Sparks.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/rts/Sparks.c b/rts/Sparks.c
index a826190941..18d9597ec2 100644
--- a/rts/Sparks.c
+++ b/rts/Sparks.c
@@ -63,13 +63,7 @@ newSpark (StgRegTable *reg, StgClosure *p)
Capability *cap = regTableToCapability(reg);
SparkPool *pool = cap->sparks;
- /* I am not sure whether this is the right thing to do.
- * Maybe it is better to exploit the tag information
- * instead of throwing it away?
- */
- p = UNTAG_CLOSURE(p);
-
- if (closure_SHOULD_SPARK(p)) {
+ if (!fizzledSpark(p)) {
pushWSDeque(pool,p);
cap->sparks_created++;
} else {