From ffc4f125c9c8d4c328464ce9b3fbf3d8afdbd14b Mon Sep 17 00:00:00 2001 From: Richard Kistruck Date: Thu, 23 Aug 2007 17:28:16 +0100 Subject: [PATCH] Mps master: poolamc.c amcfix, amcheaderfix: (comment only) tag with ".exposed.seg" statements that require that "seg" (that is: the 'from' seg) has been ShieldExposed. (Preparatory to fixing job001706). Copied from Perforce Change: 163170 ServerID: perforce.ravenbrook.com --- mps/code/poolamc.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/mps/code/poolamc.c b/mps/code/poolamc.c index eb0412055c7..c4fbf8f46a3 100644 --- a/mps/code/poolamc.c +++ b/mps/code/poolamc.c @@ -1656,9 +1656,11 @@ Res AMCFix(Pool pool, ScanState ss, Seg seg, Ref *refIO) AVER_CRITICAL(ref < SegLimit(seg)); arena = pool->arena; + /* .exposed.seg: statements tagged ".exposed.seg" below require */ + /* that "seg" (that is: the 'from' seg) has been ShieldExposed. */ ShieldExpose(arena, seg); - newRef = (*format->isMoved)(ref); - ShieldCover(arena, seg); + newRef = (*format->isMoved)(ref); /* .exposed.seg */ + ShieldCover(arena, seg); /* .exposed.seg */ if(newRef == (Addr)0) { /* If object is nailed already then we mustn't copy it: */ @@ -1690,7 +1692,7 @@ Res AMCFix(Pool pool, ScanState ss, Seg seg, Ref *refIO) buffer = gen->forward; AVER_CRITICAL(buffer != NULL); - length = AddrOffset(ref, (*format->skip)(ref)); + length = AddrOffset(ref, (*format->skip)(ref)); /* .exposed.seg */ STATISTIC_STAT(++ss->forwardedCount); ss->forwardedSize += length; do { @@ -1716,14 +1718,14 @@ Res AMCFix(Pool pool, ScanState ss, Seg seg, Ref *refIO) } /* */ - (void)AddrCopy(newRef, ref, length); + (void)AddrCopy(newRef, ref, length); /* .exposed.seg */ ShieldCover(arena, toSeg); } while(!BUFFER_COMMIT(buffer, newRef, length)); ss->copiedSize += length; ShieldExpose(arena, seg); - (*format->move)(ref, newRef); + (*format->move)(ref, newRef); /* .exposed.seg */ ShieldCover(arena, seg); } else { /* reference to broken heart (which should be snapped out -- */ @@ -1807,9 +1809,11 @@ static Res AMCHeaderFix(Pool pool, ScanState ss, Seg seg, Ref *refIO) AVER_CRITICAL(ref < SegLimit(seg)); /* see .ref-limit */ arena = pool->arena; + /* .exposed.seg: statements tagged ".exposed.seg" below require */ + /* that "seg" (that is: the 'from' seg) has been ShieldExposed. */ ShieldExpose(arena, seg); - newRef = (*format->isMoved)(ref); - ShieldCover(arena, seg); + newRef = (*format->isMoved)(ref); /* .exposed.seg */ + ShieldCover(arena, seg); /* .exposed.seg */ if(newRef == (Addr)0) { /* If object is nailed already then we mustn't copy it: */ @@ -1840,7 +1844,7 @@ static Res AMCHeaderFix(Pool pool, ScanState ss, Seg seg, Ref *refIO) buffer = gen->forward; AVER_CRITICAL(buffer != NULL); - length = AddrOffset(ref, (*format->skip)(ref)); + length = AddrOffset(ref, (*format->skip)(ref)); /* .exposed.seg */ STATISTIC_STAT(++ss->forwardedCount); ss->forwardedSize += length; do { @@ -1867,14 +1871,14 @@ static Res AMCHeaderFix(Pool pool, ScanState ss, Seg seg, Ref *refIO) SegSetSummary(toSeg, RefSetUnion(toSummary, summary)); /* */ - (void)AddrCopy(newBase, AddrSub(ref, headerSize), length); + (void)AddrCopy(newBase, AddrSub(ref, headerSize), length); /* .exposed.seg */ ShieldCover(arena, toSeg); } while (!BUFFER_COMMIT(buffer, newBase, length)); ss->copiedSize += length; ShieldExpose(arena, seg); - (*format->move)(ref, newRef); + (*format->move)(ref, newRef); /* .exposed.seg */ ShieldCover(arena, seg); } else { /* reference to broken heart (which should be snapped out -- */