summaryrefslogtreecommitdiff
path: root/rts
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-05-16 17:14:38 -0400
committerBen Gamari <ben@smart-cactus.org>2019-10-22 12:18:39 -0400
commit56c5ebdc5d907313689ac08cbe15145f29fb83d5 (patch)
treea420d6af7f46c50fe8a0fc44b880e03e65aeb089 /rts
parente6f6823f1eb5ae43a7cd782a649f55c40a5d53fd (diff)
downloadhaskell-56c5ebdc5d907313689ac08cbe15145f29fb83d5.tar.gz
NonMoving: Prefetch segment header
Diffstat (limited to 'rts')
-rw-r--r--rts/sm/NonMoving.h9
-rw-r--r--rts/sm/NonMovingMark.c1
2 files changed, 8 insertions, 2 deletions
diff --git a/rts/sm/NonMoving.h b/rts/sm/NonMoving.h
index fdeee19d96..9ef00fdba0 100644
--- a/rts/sm/NonMoving.h
+++ b/rts/sm/NonMoving.h
@@ -203,13 +203,18 @@ INLINE_HEADER void *nonmovingSegmentGetBlock(struct NonmovingSegment *seg, nonmo
// Get the segment which a closure resides in. Assumes that pointer points into
// non-moving heap.
-INLINE_HEADER struct NonmovingSegment *nonmovingGetSegment(StgPtr p)
+INLINE_HEADER struct NonmovingSegment *nonmovingGetSegment_unchecked(StgPtr p)
{
- ASSERT(HEAP_ALLOCED_GC(p) && (Bdescr(p)->flags & BF_NONMOVING));
const uintptr_t mask = ~NONMOVING_SEGMENT_MASK;
return (struct NonmovingSegment *) (((uintptr_t) p) & mask);
}
+INLINE_HEADER struct NonmovingSegment *nonmovingGetSegment(StgPtr p)
+{
+ ASSERT(HEAP_ALLOCED_GC(p) && (Bdescr(p)->flags & BF_NONMOVING));
+ return nonmovingGetSegment_unchecked(p);
+}
+
INLINE_HEADER nonmoving_block_idx nonmovingGetBlockIdx(StgPtr p)
{
ASSERT(HEAP_ALLOCED_GC(p) && (Bdescr(p)->flags & BF_NONMOVING));
diff --git a/rts/sm/NonMovingMark.c b/rts/sm/NonMovingMark.c
index ddc1a1234a..27b2b679b7 100644
--- a/rts/sm/NonMovingMark.c
+++ b/rts/sm/NonMovingMark.c
@@ -764,6 +764,7 @@ static MarkQueueEnt markQueuePop (MarkQueue *q)
// MarkQueueEnt encoding always places the pointer to the object to be
// marked first.
prefetchForRead(&new.mark_closure.p->header.info);
+ prefetchForRead(&nonmovingGetSegment_unchecked((StgPtr) new.mark_closure.p)->block_size);
q->prefetch_queue[i] = new;
i = (i + 1) % MARK_PREFETCH_QUEUE_DEPTH;
}