aboutsummaryrefslogtreecommitdiffstats
path: root/mps/code/trace.c
diff options
context:
space:
mode:
authorRichard Brooksby2012-09-19 20:04:41 +0100
committerRichard Brooksby2012-09-19 20:04:41 +0100
commit85f3d6bbb4e329b724ecb2e15e7f688a527d7795 (patch)
tree455c9140fc3452b5437e03ebecfc79423baed6ea /mps/code/trace.c
parent847bd516aadfbf6ebe17bbf8be2bd2d1129f7db6 (diff)
downloademacs-85f3d6bbb4e329b724ecb2e15e7f688a527d7795.tar.gz
emacs-85f3d6bbb4e329b724ecb2e15e7f688a527d7795.zip
Short-circuit the cases where we set the greyness or summary of a segment to the same as it was before in all cases, rather than just in a few restricted cases in amc.
This was the result of noticing a large number of SetSetGrey events that set the segment to the same greyness when scanning ambiguous references. Copied from Perforce Change: 179567 ServerID: perforce.ravenbrook.com
Diffstat (limited to 'mps/code/trace.c')
-rw-r--r--mps/code/trace.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/mps/code/trace.c b/mps/code/trace.c
index bb4d4f1cd99..e7ab41c8d80 100644
--- a/mps/code/trace.c
+++ b/mps/code/trace.c
@@ -525,13 +525,15 @@ static Res rootFlip(Root root, void *p)
525 * The main job of traceFlip is to scan references which can't be protected 525 * The main job of traceFlip is to scan references which can't be protected
526 * from the mutator, changing the colour of the mutator from grey to black 526 * from the mutator, changing the colour of the mutator from grey to black
527 * with respect to a trace. The mutator threads are suspended while this 527 * with respect to a trace. The mutator threads are suspended while this
528 * is happening, and the mutator perceives and instantaneous change in all 528 * is happening, and the mutator perceives an instantaneous change in all
529 * the references, enforced by the shield (barrier) system. 529 * the references, enforced by the shield (barrier) system.
530 * 530 *
531 * NOTE: We don't have a way to shield the roots, so they are all scanned 531 * NOTE: We don't have a way to shield the roots, so they are all scanned
532 * here. This is a coincidence. There is no particular reason that the 532 * here. This is a coincidence. There is no theoretical reason that the
533 * roots have to be scanned at flip time. (The thread registers are unlikely 533 * roots have to be scanned at flip time, provided we could protect them
534 * ever to be protectable on stock hardware, however.) 534 * from the mutator. (The thread registers are unlikely ever to be
535 * protectable on stock hardware, however, as they were -- kind of -- on
536 * Lisp machines.)
535 * 537 *
536 * NOTE: Ambiguous references may only exist in roots, because we can't 538 * NOTE: Ambiguous references may only exist in roots, because we can't
537 * shield the exact roots and defer them for later scanning (after ambiguous 539 * shield the exact roots and defer them for later scanning (after ambiguous
@@ -1254,9 +1256,12 @@ void TraceSegAccess(Arena arena, Seg seg, AccessSet mode)
1254 Trace trace; 1256 Trace trace;
1255 TraceId ti; 1257 TraceId ti;
1256 Rank rank; 1258 Rank rank;
1259 TraceSet traces;
1260
1261 AVER(SegRankSet(seg) != RankSetEMPTY);
1257 1262
1258 /* Pick set of traces to scan for: */ 1263 /* Pick set of traces to scan for: */
1259 TraceSet traces = arena->flippedTraces; 1264 traces = arena->flippedTraces;
1260 rank = TraceRankForAccess(arena, seg); 1265 rank = TraceRankForAccess(arena, seg);
1261 res = traceScanSeg(traces, rank, arena, seg); 1266 res = traceScanSeg(traces, rank, arena, seg);
1262 1267